DrMemCS / drmem

Full source tree for the DrMem control system
MIT License
3 stars 4 forks source link

Extend the `Color` type. #107

Closed rneswold closed 6 months ago

rneswold commented 6 months ago

I envision an operator for logic block expressions that blends colors. The only way to blend a color is to provide an opacity value but our Color type doesn't have an opacity field.

The Color type is represented with a LinSrgb<u8> from the palette crate. It should be represented by a LinSrgba<u8> so that an opacity value can be given. The parsers should allow #rrggbb and #rrggbbaa formats for reading color values. If a named color is used or the alpha portion is omitted, assume full opacity.

For the GraphQL interface, a 3-element list should have an opacity of 1.0.