GitHub

< Standard Library

The type color represents a 32-bit RGBA color. A color is made up of four channels: red, green, blue, and alpha/opacity. Each channel is assigned 8 bits. Thus, a color channel can have a value ranging from 0 to 255 (inclusive).

Definitions on this page will use C to represent an arbitrary object of type color.


Properties

red

Shorthand: r

C.red -> int
// Shorthand:
C.r -> int

The value of the red color channel of C.

green

Shorthand: g

C.green -> int
// Shorthand:
C.g -> int

The value of the green color channel of C.

blue

Shorthand: b

C.blue -> int
// Shorthand:
C.b -> int

The value of the blue color channel of C.

alpha

Shorthand: a

C.alpha -> int
// Shorthand:
C.a -> int

The value of the alpha/opacity color channel of C.

Read the original on github.com ↗