Alternatives for color hex strings
In a color preset capability: Sometimes it would be more readable / precise to specify a color by not using a hex color (like #ffba00).
Color names
Colors should be allowed to be entered as free text, like "Red", "Lavender", "Sunset Orange". They will be converted into a suitable hex string by the model (we need to create an own color lookup table for this). The fixture test should ensure the correct case (each word capitalized and separated by a space) and warn/error on names that can't be converted to hex.
Using color names should become the standard way to define a color. The hex should only be used if it is exactly known from the manual. (If a new color can't be converted to hex, the lookup should be updated and not a hex string used instead.)
Resources for color lookup:
- https://github.com/meodai/color-names
- https://graf1x.com/list-of-colors-with-color-names/ (not published under a free license, but might help as well)
Color components
If we know about the individual lamps (e.g. RGBWA) and their brightness, make it possible to save these components instead of the resulting color hex string.
For example:
rgb(255, 127, 0)
cmy(0, 127, 255) (maybe think about additive/subtractive)
rgbwa(0, 255, 0, 70, 15) + White, Amber
hsv(…), hsl(…), etc. (see #505)
Some fixtures like the Robe MegaPointe (manual, page 12) also add a color wheel, maybe it'll be possible to add a color wheel index to the mixing.
These mixings should be resolved by the model into a color hex string, using the algorithm used in this fiddle (or maybe another algorithm?).
However, only few fixtures give that precise color component information.
Color filters
Color wheels often use LEE or Rosco filters. We should also think about allowing a LEE number that is mapped to the corresponding color (see #177 and #1181).
See an interesting discussion in the QLC+ repo on this topic here: https://github.com/mcallegari/qlcplus/commit/252578b93bf0bfc51cf61a515759fa1dd269ee13
OFL should have a syntax to allow colors to be defined in terms of any ColorIntensity components. Those are the elements which the fixture itself uses for generating light, e.g., if it's an RGBWA fixture, I should be able to provide a ColorPreset with 5 components. It'll be the most accurate, and it's what the manual will describe it in terms of.
The simplest (if not the most concise) method I can think of is a JSON object, e.g.,
"color": {"Red": 0, "Green": 0, "Blue": 0, "White": 255, "Amber": 0}
(I'm open to better suggestions!)
A hex string for RGB can remain as a shortcut for this, in the case where you have only those 3 components.
Thoughts?