Struct pango::Color

source · []
#[repr(transparent)]
pub struct Color { /* private fields */ }
Expand description

The Color structure is used to represent a color in an uncalibrated RGB color-space.

Implementations

Returns a textual specification of @self.

The string is in the hexadecimal form #rrrrggggbbbb, where r, g and b are hex digits representing the red, green, and blue components respectively.

Returns

a newly-allocated text string that must be freed with g_free().

Fill in the fields of a color from a string specification.

The string can either one of a large set of standard names. (Taken from the CSS Color specification, or it can be a value in the form #rgb, #rrggbb, #rrrgggbbb or #rrrrggggbbbb, where r, g and b are hex digits of the red, green, and blue components of the color, respectively. (White in the four forms is #fff, #ffffff, #fffffffff and #ffffffffffff.)

spec

a string specifying the new color

Returns

true if parsing of the specifier succeeded, otherwise false

Available on crate feature v1_46 only.

Fill in the fields of a color from a string specification.

The string can either one of a large set of standard names. (Taken from the CSS Color specification, or it can be a hexadecimal value in the form #rgb, #rrggbb, #rrrgggbbb or #rrrrggggbbbb where r, g and b are hex digits of the red, green, and blue components of the color, respectively. (White in the four forms is #fff, #ffffff, #fffffffff and #ffffffffffff.)

Additionally, parse strings of the form #rgba, #rrggbbaa, #rrrrggggbbbbaaaa, if @alpha is not None, and set @alpha to the value specified by the hex digits for a. If no alpha component is found in @spec, @alpha is set to 0xffff (for a solid color).

spec

a string specifying the new color

Returns

true if parsing of the specifier succeeded, otherwise false

alpha

return location for alpha

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

Returns the type identifier of Self.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Ensures that the type has been registered with the type system.

The resulting type after obtaining ownership.

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

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.