We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hey, in some cases, e.g. when delivering data to iOS you need a ratio rgb color. It would be great if tinycolor could also support toRgbRatio.
toRgbRatio
I think it would work like this
const color = new TinyColor('red'); color.toRgbRatio(); // { r: 1, g: 0, b: 0, a: 1 }
It should be pretty similar to toPercentageRgb since the ratio is basically a percentage value as a float from 0 to 1.
toPercentageRgb
0
1
The text was updated successfully, but these errors were encountered:
Agreed this is needed, because toRgb rounds values, which loses precision. So there's actually no way to get the exact RGB values out!
toRgb
See bgrins/TinyColor#278
Sorry, something went wrong.
No branches or pull requests
Hey, in some cases, e.g. when delivering data to iOS you need a ratio rgb color. It would be great if tinycolor could also support
toRgbRatio
.I think it would work like this
It should be pretty similar to
toPercentageRgb
since the ratio is basically a percentage value as a float from0
to1
.The text was updated successfully, but these errors were encountered: