Palette
Palette — methods
pub fn all() -> Result<Vec<Self>>
Every built-in palette.
Read from the library rather than built from this crate's own
variant list, so a library newer than this build reports its
additions as Palette::Other instead of them vanishing.
Errors
Propagates whatever the SDK reports; this one has no failure of its own.
pub fn display_name(self) -> Result<String>
The human-readable name of this palette.
For a menu or a label. Not an identifier: it is meant to be
read, it may be translated, and it is not what the library
takes back. library::names is where identifiers come from.
Errors
Propagates whatever the SDK reports.
pub fn is_alarm(self) -> Result<bool>
Whether this is one of the alarm palettes.
Asked rather than hard-coded so a picker can group or grey out the alarm palettes without knowing which they are.
Errors
Propagates whatever the SDK reports.
pub fn colors(self) -> Result<Vec<Rgb24>>
This palette's colours, coldest first.
PALETTE_COLOR_COUNT of them. Three bytes each with no
padding, so the slice is byte-for-byte an RGB8 image one pixel
high, which is what a gradient strip is.
Errors
Propagates whatever the SDK reports.