pub struct Palette {
colors: [Color; 16],
is_dark: bool,
}Expand description
Fields§
§colors: [Color; 16]§is_dark: boolWhether this is a dark scheme (B00 darker than B07). Read by the
shell to pick the host’s own light/dark preset; ignored by the canvas
renderers.
Implementations§
Source§impl Palette
impl Palette
Sourcepub fn resolve(&self, swatch: Swatch) -> Color
pub fn resolve(&self, swatch: Swatch) -> Color
Resolve a Swatch to a concrete color: its base color from the palette
dimmed by its alpha. A swatch with no base resolves to fully transparent.
Sourcepub fn tokyo_night_moon() -> Self
pub fn tokyo_night_moon() -> Self
The Tokyo Night Moon scheme (base16). B00 is the canvas/background,
B05 the default foreground, B08..B0F the accents (red, orange,
yellow, green, cyan, blue, magenta, dark-red).
Sourcepub fn toned(&self, saturation: Saturation) -> Self
pub fn toned(&self, saturation: Saturation) -> Self
This palette with saturation applied to every slot — the canvas’s
half of the read-only signal.
Source§impl Palette
The six user-selectable base16 scheme families, each in a dark and a light
variant. Values are the canonical tinted-theming base16 palettes; the base16
slot order matches this module’s Base (B00 background … B05 foreground;
B08..B0F the accents red, orange, yellow, green, cyan, blue, magenta, brown).
impl Palette
The six user-selectable base16 scheme families, each in a dark and a light
variant. Values are the canonical tinted-theming base16 palettes; the base16
slot order matches this module’s Base (B00 background … B05 foreground;
B08..B0F the accents red, orange, yellow, green, cyan, blue, magenta, brown).
Sourceconst fn base16(luminance: Luminance, hexes: [u32; 16]) -> Self
const fn base16(luminance: Luminance, hexes: [u32; 16]) -> Self
Build a palette from 16 0xRRGGBB values in base16 slot order.