OpenLightingProject / OpenLightingProject/open-fixture-library
Alternatives for color hex strings
Nobody has claimed this yet.
- Dominant language
- JSON
- Stars
- 258
- Forks
- 100
- Avg merge
- 11h 52m
- Merged PRs (30d)
- 53
Description
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).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the fixture test and model handling color presets, then review the color-name resources and related issues #505, #177, and #1181. Done requires an agreed representation for names, component values, and filters, with conversion behavior and invalid-name handling covered by tests.
Written by the indexing model from the issue text.
Assessment
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100