tinycolor
tinycolor copied to clipboard
[Feature request]: toRgbRatio
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
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
.