unitToRgb
Converts a color whose channels are floats from 0 to 1 (as Figma, Sketch and Penpot store
them) into an RgbColor, with channels from 0 to 255. Alpha is already 0–1 and
is kept as it is. The channels are not rounded: rgbToCss and rgbToHex do it.
Available since v3.1.10
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
color | RgbColor | The color, with `r`, `g`, `b` from `0` to `1`. `a` defaults to 1 (opaque) |
Returns
Section titled “Returns”RgbColor — The color with channels from 0 to 255
Examples
Section titled “Examples”Read a design tool color
Section titled “Read a design tool color”Figma, Sketch and Penpot store channels from 0 to 1.
Related Types
Section titled “Related Types”RgbColor
Section titled “RgbColor”An RGB(A) color with channels expressed as plain numbers, convenient for further conversion or manipulation.
