Type Alias RgbF64

Source
pub type RgbF64 = Rgb<f64>;
Available on crate feature color only.
Expand description

RGB color with 64-bit float components (sRGB gamma space).

Aliased Type§

#[repr(C)]
pub struct RgbF64 { pub c: [f64; 3], }

Fields§

§c: [f64; 3]

Color channels in order: [red, green, blue].

  • Red/Green/Blue: Gamma-encoded luminosity (0..=255).

Implementations§

Source§

impl RgbF64

Source

pub const fn new(r: f64, g: f64, b: f64) -> RgbF64

New RgbF64.

Source

pub const fn red(self) -> f64

The red component.

Source

pub const fn r(self) -> f64

Source

pub const fn green(self) -> f64

The green component.

Source

pub const fn g(self) -> f64

Source

pub const fn blue(self) -> f64

The blue component.

Source

pub const fn b(self) -> f64

Trait Implementations§

Source§

impl Color for RgbF64

Source§

fn color_alpha(&self) -> Self::Component

Since the color has no alpha, the maximum normalized value is returned.

Source§

const COLOR_BITS: usize = 64usize

The bit depth of each color component (e.g., 8 for u8, 32 for f32).
Source§

const COLOR_COUNT: usize = 3usize

The number of color components (channels) in the representation. Read more
Source§

const COLOR_HAS_ALPHA: bool = false

Whether the color has an alpha component are integer types (e.g., u8, u16).
Source§

const COLOR_IS_LINEAR: bool = false

Whether the color space is linear (as opposed to non-linear, e.g., sRGB). Read more
Source§

const COLOR_IS_INT: bool = false

Whether the color components are integer types (e.g., u8, u16). Read more
Source§

const COLOR_IS_PREMUL: bool = false

Whether the color uses premultiplied alpha (vs. straight/unassociated alpha). Read more
Source§

type Component = f64

The type of a single color component (e.g., u8, f32).
Source§

fn color_red(&self) -> Self::Component

Get the red component.
Source§

fn color_green(&self) -> Self::Component

Get the green component.
Source§

fn color_blue(&self) -> Self::Component

Get the blue component.
Source§

fn color_components_write(&self, b: &mut [f64]) -> Result<(), NotEnoughSpace>

Writes the color components to a pre-allocated buffer. Read more
Source§

fn color_bits(&self) -> usize

Returns the bit depth of each color component (e.g., 8 for u8, 32 for f32).
Source§

fn color_count(&self) -> usize

Returns the number of color components (channels).
Source§

fn color_has_alpha(&self) -> bool

Returns true if the color has an alpha component.
Source§

fn color_is_int(&self) -> bool

Returns true if the color uses integer components (e.g., u8, u16).
Source§

fn color_is_linear(&self) -> bool

Returns true if the color is in a linear space (not gamma-encoded like sRGB).
Source§

fn color_is_premul(&self) -> bool

Returns true if the color uses premultiplied alpha.
Source§

fn color_components_vec(&self) -> Vec<Self::Component>
where Self::Component: Default + Clone,

Available on crate feature alloc only.
Returns a vector containing the color components.