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

CSS Colors version 3.0 #2908

Open
2 of 6 tasks
mrtnzlml opened this issue Aug 6, 2021 · 0 comments
Open
2 of 6 tasks

CSS Colors version 3.0 #2908

mrtnzlml opened this issue Aug 6, 2021 · 0 comments

Comments

@mrtnzlml
Copy link
Member

mrtnzlml commented Aug 6, 2021

I am currently a bit busy to start working on this but I would like to outline here how should the @adeira/css-colors package evolve for the future 3.0 major version. Basically, the main goal of this release should be to get rid of the [R, G, B] triplet and replace it with some better structure that includes an alpha channel as well.

Public interface changes:

  • calculateContrastRatio should accept the new structure instead of RGB triplets
  • isAccessible should accept the new structure instead of RGB triplets
  • chooseHigherContrast should accept the new structure instead of RGB triplets (also please note this comment: Colors: add new function chooseHigherContrast #2741 (review))
  • remove deprecated isDark (e7f1673)
  • remove deprecated isBright (e7f1673)
  • remove convertToRGBTriplet (doesn't make sense anymore with the new structure)

Unchanged functions:

  • cssColorNames, isColor, normalizeColor, hex3ToHex6, hex6ToHex3

Inspiration: https://github.com/d3/d3-color

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

No branches or pull requests

1 participant