Module color

Module color 

Source
Expand description

Color

Modulesยง

cache_key
Hashing and other caching utilities for Color types.
palette
Palettes with predefined colors.
palettes
palettes
prelude
Color preludes

Structsยง

A98Rgb
๐ŸŒŒ The Adobe RGB (1998) color space.
Aces2065_1
๐ŸŒŒ The ACES2065-1 color space.
AcesCg
๐ŸŒŒ The ACEScg color space.
AlphaColor
A color with an alpha channel.
Chromaticity
CIE xy chromaticity, specifying a color in the XYZ color space, but not its luminosity.
DisplayP3
๐ŸŒŒ The Display P3 color space, often used for wide-gamut displays.
DynamicColor
A color with a color space tag decided at runtime.
Flags
Flags indicating DynamicColor state.
GradientIter
The iterator for gradient approximation.
Hsl
๐ŸŒŒ The HSL color space
Hwb
๐ŸŒŒ The HWB color space
Interpolator
An intermediate struct used for interpolating between colors.
Lab
๐ŸŒŒ The CIELAB color space
Lch
๐ŸŒŒ The cylindrical version of the Lab color space.
LinearSrgb
๐ŸŒŒ The linear-light RGB color space with sRGB primaries.
Missing
Missing color components, extracted from Flags.
Oklab
๐ŸŒŒ The Oklab color space, intended to be a perceptually uniform color space.
Oklch
๐ŸŒŒ The cylindrical version of the Oklab color space.
OpaqueColor
An opaque color.
PremulColor
A color with premultiplied alpha.
PremulRgba8
A packed representation of pre-multiplied sRGB colors.
ProphotoRgb
๐ŸŒŒ The ProPhoto RGB color space.
Rec2020
๐ŸŒŒ The Rec. 2020 color space.
Rgba8
A packed representation of sRGB colors.
Srgb
๐ŸŒŒ The standard RGB color space.
UnpremultipliedGradientIter
The iterator for gradient approximation.
UnpremultipliedInterpolator
An intermediate struct used for interpolating between colors.
XyzD50
๐ŸŒŒ The CIE XYZ color space with a 2ยฐ observer and a reference white of D50.
XyzD65
๐ŸŒŒ The CIE XYZ color space with a 2ยฐ observer and a reference white of D65.

Enumsยง

ColorSpaceLayout
The layout of a color space, particularly the hue component.
ColorSpaceTag
The color space tag for dynamic colors.
HueDirection
The hue direction for interpolation.
ParseError
Error type for parse errors.

Traitsยง

ColorSpace
The main trait for color spaces.

Functionsยง

color
Parse color string to AlphaColor<Srgb>
gradient
Generate a piecewise linear approximation to a gradient ramp.
gradient_unpremultiplied
Generate a piecewise linear approximation to a gradient ramp without alpha premultiplication.
parse_color
Parse a color string in CSS syntax into a color.
parse_color_prefix
Parse a color string prefix in CSS syntax into a color.
rgb
Construct an AlphaColor<Srgb> from rgb f32, the alpha value will be 1.0
rgb8
Construct an AlphaColor<Srgb> from rgb u8, the alpha value will be 255
rgba
Construct an AlphaColor<Srgb> from rgba f32
rgba8
Construct an AlphaColor<Srgb> from rgba u8
try_color
Parse color string to AlphaColor<Srgb> without panic