Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(areabrick-overview): automatic colors for additional properties #35

Merged
merged 7 commits into from
Nov 6, 2024

Conversation

jdreesen
Copy link
Member

@jdreesen jdreesen commented Oct 25, 2024

Currently, only additional properties with name tags and groups are colored.

This PR adds an algorithm that automatically colors any tag depending on its name. This works by hashing the name and converting the resulting hash to an HSL color within a given range (which allows us to only create blueish colors, for example).

Then the luminosity of the background color is determined to decide whether the text should be displayed in white or black.

Currently, only bluish colors are generated (see 3873a6f):

grafik

Resolves #25

Copy link
Collaborator

@mike4git mike4git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried to understand what you did but I'm missing (atm).
So I've asked our Twig expert Steffi to have a look upon it and be impressed or disappointed - let's see ;-)

Copy link
Collaborator

@nsd0sketzler nsd0sketzler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@jdreesen jdreesen merged commit 1af3e2c into main Nov 6, 2024
4 checks passed
@jdreesen jdreesen deleted the feature/autocolor branch November 6, 2024 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Areabrick Overview] colors of additional properties
3 participants