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

Add support for color() #43

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Add support for color() #43

wants to merge 9 commits into from

Conversation

Juice10
Copy link

@Juice10 Juice10 commented Sep 17, 2024

Add support for color() which addresses part of #8

Also:

  • Updates dependencies and commands to work better with newer versions of node
  • Relaxes ReDos protection by two characters. This is due to chrome using up to 7 floating point decimals when converting an rgb() function into color(). Eg. rgb(from MidnightBlue r g b) becomes color(srgb 0.0980392 0.0980392 0.439216)

Out of scope:

  • Adding support for from clause. I wasn't able to finish this as it creates a regex where colors can be nested inside colors pretty much infinitely. Regex is not the best solution for this so I'm stepping over it for now.

@Juice10 Juice10 marked this pull request as ready for review September 18, 2024 14:44
src/validate-color/index.js Outdated Show resolved Hide resolved
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.

1 participant