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

Rewrite color logic for better flexibility #2855

Closed
Thunear opened this issue Dec 2, 2024 · 0 comments · Fixed by #2854
Closed

Rewrite color logic for better flexibility #2855

Thunear opened this issue Dec 2, 2024 · 0 comments · Fixed by #2854
Assignees
Labels
cli @digdir/designsystemet

Comments

@Thunear
Copy link
Collaborator

Thunear commented Dec 2, 2024

We currently use a package called Leonardo JS API to generate the colors for our color-system. This is not a very elegant solution because they base their color generation off of contrast, rather than lightness and luminance from the API. It also gives us a bit less control for how we want to generate the colors. Behind the scenes Leonardo uses Chroma.js to generate colors with relative luminance that also have color interpolation built in.

  • Change to use Chroma.js to generate all the colors based on relative luminance.
  • Keep using HSLuv lightness-calculations for the Base- and contrast colors for better human color-perception
  • Move the luminance values to its own file
  • Simplify logic with Ramda
@Thunear Thunear converted this from a draft issue Dec 2, 2024
@Thunear Thunear self-assigned this Dec 2, 2024
@Thunear Thunear changed the title Rewrite color logic Rewrite color logic for better flexability Dec 2, 2024
@Thunear Thunear added the cli @digdir/designsystemet label Dec 2, 2024
@Thunear Thunear changed the title Rewrite color logic for better flexability Rewrite color logic for better flexibility Dec 2, 2024
@Barsnes Barsnes moved this from 🏗 In progress to 👀 Ready for review in Team Design System Dec 6, 2024
@mimarz mimarz closed this as completed in 171eba9 Dec 10, 2024
@github-project-automation github-project-automation bot moved this from 👀 Ready for review to ✅ Done in Team Design System Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli @digdir/designsystemet
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant