rgbToUnit
Converts an RgbColor (channels from 0 to 255) into a color whose channels are floats
from 0 to 1, the way Figma, Sketch and Penpot store them. Alpha is kept as it is.
Available since v3.1.10
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
color | RgbColor | The color. `a` defaults to 1 (opaque) |
Returns
Section titled “Returns”RgbColor — The color with r, g, b from 0 to 1
Examples
Section titled “Examples”Write a design tool color
Section titled “Write a design tool color”Channels from 0 to 1, alpha unchanged.
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.
