[PATCH weston 1/2] config-parser: add support for more color formats
eric.engestrom at imgtec.com
Fri Oct 21 15:02:15 UTC 2016
On Friday, 2016-10-21 12:30:07 +0200, Quentin Glidic wrote:
> On 20/10/2016 00:08, Eric Engestrom wrote:
> > Valid colours start with an optional '0x' or '#', followed by:
> > - AARRGGBB
> > - RRGGBB
> > - A R G B
> > - R G B
> > - XYXYXY
> > - XXXXXX
> I think this is way too much, even with minimal code effort.
> The well-known CSS formats are #RRGGBB and #RGB, and the backward-compatible
> extension are #RRGGBBAA and #RGBA.
> The current 0xAARRGGBB are directly derived from the internal usage of a
> colour as a number, because Weston devs are used to this. But *users* are
> not, they are used to CSS notation.
> IMO, 0x should be used as-is, with a little clamping, so the old way
> continue to work. OTOH, the # notation should be fully compatible with CSS.
> This code would lead to user-unexpected behaviour, and it’s easy to avoid
You're right, I didn't really think this through :)
I'll send a v2 with only commonly used formats/orders when
I have some more time (probably sunday):
- (0x)(AA)RRGGBB (backward compatibility)
Bryce, I think you wanted a single repeating char format; do you also
want the 2-char format?
More information about the wayland-devel