diff options
author | Manuel Stoeckl <code@mstoeckl.com> | 2023-12-17 10:54:46 -0500 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-12-20 16:17:23 +0100 |
commit | eabc06e7eb9e5cb08c8177f49753dedc505076b4 (patch) | |
tree | c4b8b8520fe82d1bf84ac421ad19df74b62090fa /background-image.c | |
parent | 435be14610a4b4538adc6a926160ed434ff630fa (diff) | |
download | swaybg-eabc06e7eb9e5cb08c8177f49753dedc505076b4.tar.gz swaybg-eabc06e7eb9e5cb08c8177f49753dedc505076b4.tar.bz2 |
Unify color validation and parsing functions
Before this change, parse_color() and is_valid_color() behaved slightly
differently: parse_color() accepted both colors with and without alpha,
with optional leading #, while is_valid_color() forbade alpha and required
a leading # character. This commit merges the two functions into one
simpler function that forbids alpha and allows an optional leading #.
(Alpha values are forbidden because backgrounds should be opaque; a
leading # is optional to make shell scripts easier to write.)
Diffstat (limited to 'background-image.c')
0 files changed, 0 insertions, 0 deletions