tinycolor icon indicating copy to clipboard operation
tinycolor copied to clipboard

[Feature request]: toRgbRatio

Open lukasoppermann opened this issue 3 years ago • 1 comments

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.

lukasoppermann avatar Sep 09 '21 12:09 lukasoppermann