argbToRgb
Converts a 32-bit packed ARGB integer (as used by e.g. Chromium’s
Local State profile background_color field) into a CSS rgb() string.
The alpha byte (top 8 bits) is read but discarded — the result is always opaque.
Available since v3.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
argb | number | A 32-bit integer where bits 24-31 are alpha, 16-23 are red, 8-15 are green, and 0-7 are blue |
Returns
Section titled “Returns”string — A rgb(r,g,b) CSS color string
Examples
Section titled “Examples”Convert a packed ARGB integer to a CSS color
Section titled “Convert a packed ARGB integer to a CSS color”The top byte (alpha) is discarded — the result is always opaque.
Alpha byte does not affect the result
Section titled “Alpha byte does not affect the result”Two ARGB values differing only in the alpha byte produce the same rgb() string.
