Skip to content

Conversation

@camdecoster
Copy link
Contributor

@camdecoster camdecoster commented Aug 29, 2025

Description

Updates rgb regex to handle decimal fractions, scientific notation.

Closes #77.

Changes

  • Updates rgb regex
  • Parses regex results as floats
  • Adds tests per above changes

Testing

  • Be on master
  • Call the library with decimal fraction values: cs.get("rgb(1, 2.0, 3)")
  • Call the library with scientific notation values: cs.get("rgb(1e2, 2.0E2, 3e2)")
  • Note that a null value is returned for both calls
  • Switch to this branch
  • Call the library with decimal fraction values: cs.get("rgb(1, 2.0, 3)")
  • Call the library with scientific notation values: cs.get("rgb(1e2, 2.0E2, 3e2)")
  • Note that an array of numbers is returned with the proper values for both calls

@camdecoster camdecoster changed the title feat: Add decimal fraction support feat: Add rgb decimal fraction, scientific notation support Sep 2, 2025
@camdecoster
Copy link
Contributor Author

Hello @Qix-! Do you have time to take a look at this PR and #81?

@Qix- Qix- merged commit ccdb4e6 into Qix-:master Oct 17, 2025
@Qix-
Copy link
Owner

Qix- commented Oct 17, 2025

Hi there, thanks! Might be a little bit before it's released unfortunately, and sorry it took so long to review - have had a very long four weeks and I'm currently sick.

@camdecoster camdecoster deleted the cam/77/add-rgb-decimal-fraction-support branch October 18, 2025 13:15
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.

RGB numbers with a decimal fraction are treated as invalid even though they're valid CSS

2 participants