Orange-OpenSource / Orange-OpenSource/IOT-Map-Component
"Automatic" inner color
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 24
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Inner color defined in statuses or templates is defined according to functional color, to highlight the inner. In the case of a dark functional color, the inner color is set to "white".
However in the case of "plain = false" or a gauge, the background is white and the border of the functional color => invisible inner.
→ Force the inner color to "black"
In Map Component:
- Functional color and additional ones proposed by @mccart77 will be available through default status and templates, defined for markers (see https://github.com/Orange-OpenSource/IOT-Map-Component#presentation)
- But we also will leave the developer free to use another color
At the same time, we would like to simplify the use of the component by setting the color of label/icon to white vs. black according to the background color of the marker.
Can be done according to the following algorithm (which is aligned with @mccart77 specifications for functional markers color):
- Background Luminance = .3R+.6V+.1B
- If Luminance >= 128 set the icon / label in black
- If Luminance < 128 set the icon / label in white
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 in the Map Component's marker color handling and trace how statuses and templates set functional and inner colors, including plain=false and gauges. Implement the stated luminance threshold so labels and icons use black or white appropriately, and verify that the inner color remains visible in the described cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100