Skip to content

[Feature request]: toRgbRatio #227

@lukasoppermann

Description

@lukasoppermann

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions