Skip to content

Conversation

@LitoMore
Copy link
Collaborator

@LitoMore LitoMore commented Feb 13, 2025

Changes

Some lines are theoretically unreachable (unless the regex pattern has a bug). For TypeScript to determine the type, I wrote a polite condition such as if (!r || !g || !b) return undefined and ignored its coverage.

Notable changes

  • Now all get and to function parameters will be clamped
  • Fix some issues with negative numbers
     colorString.to.hex(255, 10, 35, -1)
     //=> FF0A23-FF
     
     toHex(255, 10, 35, -1)
     //=> FF0A2300
    
     colorString.to.rgb(-255, -10, -35)
     //=> rgb(-255, -10, -35)
    
     toRgb(-255, -10, -35)
     //=> rgb(0, 0, 0)

@LitoMore LitoMore requested a review from Qix- February 13, 2025 00:32
@LitoMore LitoMore marked this pull request as draft February 14, 2025 12:03
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