GPUI.Color (gpui v0.2.0)

Copy Markdown View Source

Compile-time hexadecimal RGB and RGBA color literals.

~RGB accepts three or six hexadecimal digits. ~RGBA accepts four or eight hexadecimal digits. Short literals expand each digit, so ~RGB"abc" is equivalent to {:rgb, 0xAABBCC}.

These sigils deliberately omit a leading # because their names already identify the literal as a hexadecimal color.

Summary

Functions

Builds an opaque RGB literal from three or six hexadecimal digits.

Builds an RGBA literal from four or eight hexadecimal digits.

Types

rgb()

@type rgb() :: {:rgb, 0..16_777_215}

rgba()

@type rgba() :: {:rgba, 0..4_294_967_295}

t()

@type t() :: rgb() | rgba()

Functions

sigil_RGB(arg1, modifiers)

(macro)

Builds an opaque RGB literal from three or six hexadecimal digits.

sigil_RGBA(arg1, modifiers)

(macro)

Builds an RGBA literal from four or eight hexadecimal digits.