Color

RGBA colors.

Channels are 8-bit sRGB values. Alpha is 0 for transparent and 255 for fully opaque. A color is a plain value: build one, keep it in the model, and hand it to any drawing call.

The named constants cover the common cases, from_hex_rgb reads the form a designer hands over, and with_alpha makes any of them translucent.

accent = Color.from_hex_rgb(0x2f80ed)
glow = Color.with_alpha(accent, 100)

These types live in the companion roc-ray-types package and are re-exported here, so a value passes between the two spellings freely and a library can depend on the package without depending on this platform.

rgba : U8, U8, U8, U8 -> Rgba

Construct a color from red, green, blue, and alpha channels.

rgb : U8, U8, U8 -> Rgba

Construct an opaque color from red, green, and blue channels.

with_alpha : Rgba, U8 -> Rgba

Return a copy with a new alpha channel.

blue : Rgba

Raylib's standard blue.

dark_gray : Rgba

Raylib's standard dark gray.

gray : Rgba

Raylib's standard gray.

green : Rgba

Raylib's standard green.

orange : Rgba

Raylib's standard orange.

pink : Rgba

Raylib's standard pink.

purple : Rgba

Raylib's standard purple.

ray_white : Rgba

Raylib's warm off-white background color.

red : Rgba

Raylib's standard red.

yellow : Rgba

Raylib's standard yellow.

Rgba : Rgba

An 8-bit sRGB color with alpha. Color.Rgba on the platform is this same type, re-exported.