logo
Expand description

Describe colors.

Modules

Exposed namespace of the module.

Orphan namespace of the module.

Prelude to use essentials: use my_module::prelude::*.

Protected namespace of the module.

Structs

The RGB pixel

The RGBA pixel

RGBA

Traits

Casts a slice of bytes into a slice of pixels, e.g. [u8] to [RGB8].

Same as ComponentMap, but doesn’t change the alpha channel (if there’s any alpha).

Casting a slice of RGB/A values to a slice of u8

Applying operation to every component

Casting the struct to slices of its components

Cast a slice of component values (bytes) as a slice of RGB/RGBA pixels

Marker trait for “plain old data”.

Convertable into RGBA.

Trait for types that can be safely created with zeroed.

Type Definitions

8-bit RGB

16-bit RGB in machine’s native endian

8-bit RGBA, alpha is last. 0 = transparent, 255 = opaque.

16-bit RGB in machine’s native endian. 0 = transparent, 65535 = opaque.