Orange-OpenSource / Orange-OpenSource/IOT-Map-Component

"Automatic" inner color

Open
#59 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
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:

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.