Skip to content

Consistently handle none/NaN across library - #476

Merged
facelessuser merged 2 commits into
color-js:mainfrom
facelessuser:bugfix/none-handling
Mar 14, 2024
Merged

facelessuser merged 2 commits into
color-js:mainfrom
facelessuser:bugfix/none-handling

Conversation

@facelessuser

Copy link
Copy Markdown
Collaborator

This fixes bad conversion due to "none" usage and other "none" related issues.
Ref #475

@netlify

netlify Bot commented Mar 10, 2024 •

Copy link
Copy Markdown

βœ… Deploy Preview for colorjs ready!

Name Link
πŸ”¨ Latest commit 03a91b4
πŸ” Latest deploy log https://app.netlify.com/sites/colorjs/deploys/65ee52a7dcfdc70008b79b76
😎 Deploy Preview https://deploy-preview-476--colorjs.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@lloydk lloydk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for the APCA contrast method which doesn't handle colors with none.

> new Color("red").contrast(new Color("rgb(none 100% 100%)"), "apca");
> NaN

@facelessuser

Copy link
Copy Markdown
Collaborator Author

Yeah, I was fixing existing handling, I didn't try to identify new broken cases πŸ™‚

@facelessuser

Copy link
Copy Markdown
Collaborator Author

I'll address it.

@facelessuser

Copy link
Copy Markdown
Collaborator Author

Done

> new Color("red").contrast(new Color("rgb(none 100% 100%)"), "apca");
-53.91362069001541

Comment thread src/contrast/APCA.js Resolved

@LeaVerou LeaVerou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic work, thank you so much!!

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.

3 participants