unpremultiply
Divides the color channels by the alpha channel: the inverse of premultiply. A fully transparent color has lost its channels, so it comes back as transparent black.
Available since v3.1.8
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
color | RgbColor | A premultiplied color; a missing alpha is 1 |
Returns
Section titled “Returns”RgbColor — The straight (non-premultiplied) color
Examples
Section titled “Examples”Recover the straight color
Section titled “Recover the straight color”Divides the channels by the alpha, the inverse of premultiply.
A transparent color becomes transparent black
Section titled “A transparent color becomes transparent black”The channels are lost at alpha 0, so there is nothing to recover.
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.
