Trait gegl::prelude::ColorExt

source ·
pub trait ColorExt: IsA<Color> + Sealed + 'static {
    // Provided methods
    fn duplicate(&self) -> Option<Color> { ... }
    fn components(&self, format: &mut Value) -> Vec<f64> { ... }
    fn rgba(&self) -> (f64, f64, f64, f64) { ... }
    fn set_components(&self, format: &mut Value, components: &[f64]) { ... }
    fn set_rgba(&self, red: f64, green: f64, blue: f64, alpha: f64) { ... }
    fn string(&self) -> Option<GString> { ... }
    fn set_string(&self, string: Option<&str>) { ... }
    fn connect_string_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Color methods.

Implementors

Color

Provided Methods§

source

fn duplicate(&self) -> Option<Color>

Creates a copy of self.

Returns

A new copy of self.

source

fn components(&self, format: &mut Value) -> Vec<f64>

Get the component values of the color in format.

format

A Babl pointer

Returns

The color components If value format not supported return NULL and components_length set to 0.

source

fn rgba(&self) -> (f64, f64, f64, f64)

Retrieves the current set color as linear light non premultipled RGBA data, any of the return pointers can be omitted.

Returns
red

red return location.

green

green return location.

blue

blue return location.

alpha

alpha return location.

source

fn set_components(&self, format: &mut Value, components: &[f64])

Set the color using the component values as format.

format

A Babl pointer

components

The color components.

source

fn set_rgba(&self, red: f64, green: f64, blue: f64, alpha: f64)

Set color as linear light non premultipled RGBA data

red

red value

green

green value

blue

blue value

alpha

alpha value

source

fn string(&self) -> Option<GString>

source

fn set_string(&self, string: Option<&str>)

source

fn connect_string_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Implementors§

source§

impl<O: IsA<Color>> ColorExt for O