config: improve validation of color values, default alpha to 0xff

Reject color values that aren't in either RGB, or ARGB format. That
is, color values that aren't hexadecimal numbers with either 6 or 8
digits.

Also, if a color value is allowed to have an alpha component, and the
user left it out, default to 0xff (opaque) rather than 0x00 (fully
transparent).

Closes #1526
This commit is contained in:
Daniel Eklöf 2023-10-26 16:22:41 +02:00
parent 85a4e4ccc1
commit 02fff24b4f
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 34 additions and 6 deletions

View file

@ -52,9 +52,21 @@
## Unreleased
### Added
### Changed
* config: ARGB color values now default to opaque, rather than
transparent, when the alpha component has been left out
([#1526][1526]).
[1526]: https://codeberg.org/dnkl/foot/issues/1526
### Deprecated
### Removed
### Fixed
* config: improved validation of color values.
### Security
### Contributors