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

Wheel using HEX instead of HSVA #108

Open
liztulino opened this issue Mar 22, 2023 · 2 comments
Open

Wheel using HEX instead of HSVA #108

liztulino opened this issue Mar 22, 2023 · 2 comments

Comments

@liztulino
Copy link

I see Colorful can use hex; is there a way we can implement hex with the Wheel component instead of hsva? Really great tools! Thanks.

@jaywcjlove
Copy link
Member

https://github.com/uiwjs/react-color/blob/main/packages/color-convert/README.md

const { rgb, rgba, hsl, hsv, hsla, hsva } = color('#d1021a');
// rgb   => { b: 26, g: 2, r: 209, }
// rgba  => { b: 26, g: 2, r: 209, a: 1 }
// hsl   => { h: 353.04347826086956, l: 41.37254901960784, s: 98.10426540284361 }
// hsla  => { h: 353.04347826086956, l: 41.37254901960784, s: 98.10426540284361, a: 1 }
// hsv   => { h: 353.04347826086956, s: 99.04306220095694, v: 81.96078431372548 }
// hsva  => { h: 353.04347826086956, s: 99.04306220095694, v: 81.96078431372548, a: 1 }
// hex   => '#d1021a'
// hexa  => '#d1021aff'

@jaywcjlove
Copy link
Member

You can use @uiw/color-convert to convert HEX to HSVA

@liztulino

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

2 participants