Struct gdk4::RGBA[][src]

#[repr(C)]
pub struct RGBA { pub red: f32, pub green: f32, pub blue: f32, pub alpha: f32, }
Expand description

A RGBA is used to represent a color, in a way that is compatible with cairo’s notion of color.

RGBA is a convenient way to pass colors around. It’s based on cairo’s way to deal with colors and mirrors its behavior. All values are in the range from 0.0 to 1.0 inclusive. So the color (0.0, 0.0, 0.0, 0.0) represents transparent black and (1.0, 1.0, 1.0, 1.0) is opaque white. Other values will be clamped to this range when drawing.

Fields

red: f32green: f32blue: f32alpha: f32

Implementations

Creates a new builder-style object to construct a RGBA.

This method returns an instance of RGBABuilder which can be used to create a RGBA.

Checks if an self value is opaque.

That is, drawing with the value will not retain any results from previous contents.

Returns

true if the self is opaque

Checks if an self value is transparent.

That is, drawing with the value would not produce any change.

Returns

true if the self is clear

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Value type checker.

Get the contained value from a Value. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Returns the type identifier of Self.

Convert a value to a Value.

Returns the type identifer of self. Read more

Convert an Option to a Value.

Type to get the Type from. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Returns a SendValue clone of self.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.