Struct qmetaobject::QColor

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

Wrapper around QColor class.

Implementations§

source§

impl QColor

source

pub fn from_name(name: &str) -> QColor

Wrapper around QColor(QLatin1String) constructor.

source

pub fn from_global_color(color: QGlobalColor) -> QColor

Wrapper around QColor(Qt::GlobalColor) constructor.

source

pub fn from_cmyk(c: i32, m: i32, y: i32, k: i32) -> QColor

source

pub fn from_cmyka(c: i32, m: i32, y: i32, k: i32, a: i32) -> QColor

source

pub fn from_cmyk_f(c: f64, m: f64, y: f64, k: f64) -> QColor

source

pub fn from_cmyka_f(c: f64, m: f64, y: f64, k: f64, a: f64) -> QColor

source

pub fn from_hsl(h: i32, s: i32, l: i32) -> QColor

source

pub fn from_hsla(h: i32, s: i32, l: i32, a: i32) -> QColor

source

pub fn from_hsl_f(h: f64, s: f64, l: f64) -> QColor

source

pub fn from_hsla_f(h: f64, s: f64, l: f64, a: f64) -> QColor

source

pub fn from_hsv(h: i32, s: i32, v: i32) -> QColor

source

pub fn from_hsva(h: i32, s: i32, v: i32, a: i32) -> QColor

source

pub fn from_hsv_f(h: f64, s: f64, v: f64) -> QColor

source

pub fn from_hsva_f(h: f64, s: f64, v: f64, a: f64) -> QColor

source

pub fn from_rgb(r: i32, g: i32, b: i32) -> QColor

source

pub fn from_rgba(r: i32, g: i32, b: i32, a: i32) -> QColor

source

pub fn from_rgb_f(r: f64, g: f64, b: f64) -> QColor

Wrapper around fromRgbF(qreal r, qreal g, qreal b, qreal a = 1.0) constructor.

Wrapper-specific

Alpha is left at default 1.0. To set it to something other that 1.0, use from_rgba_f.

source

pub fn from_rgba_f(r: f64, g: f64, b: f64, a: f64) -> QColor

Wrapper around fromRgbF(qreal r, qreal g, qreal b, qreal a = 1.0) constructor.

Wrapper-specific

Same as from_rgb_f, but accept an alpha value

source

pub fn from_rgb64(r: u16, g: u16, b: u16) -> QColor

source

pub fn from_rgba64(r: u16, g: u16, b: u16, a: u16) -> QColor

source

pub fn from_qrgba64(rgba64: QRgba64) -> QColor

source

pub fn from_qrgb(rgb: QRgb) -> QColor

source

pub fn is_valid_color(name: &str) -> bool

source

pub fn alpha(&self) -> i32

source

pub fn alpha_f(&self) -> f64

source

pub fn black(&self) -> i32

source

pub fn black_f(&self) -> f64

source

pub fn blue(&self) -> i32

source

pub fn blue_f(&self) -> f64

source

pub fn convert_to(&self, color_spec: QColorSpec) -> QColor

source

pub fn cyan(&self) -> i32

source

pub fn cyan_f(&self) -> f64

source

pub fn darker(&self, factor: Option<i32>) -> QColor

source

pub fn get_cmyka(&mut self) -> (i32, i32, i32, i32, i32)

This function should be const but at least in my local include (5.12) it is not marked as const and causes compilation to fail

void getCmyk(int *c, int *m, int *y, int *k, int *a = nullptr);

source

pub fn get_cmyka_f(&mut self) -> (f64, f64, f64, f64, f64)

This function should be const but at least in my local include (5.12) it is not marked as const and causes compilation to fail

void getCmykF(qreal *c, qreal *m, qreal *y, qreal *k, qreal *a = nullptr);

source

pub fn get_hsla(&self) -> (i32, i32, i32, i32)

source

pub fn get_hsla_f(&self) -> (f64, f64, f64, f64)

source

pub fn get_hsva(&self) -> (i32, i32, i32, i32)

source

pub fn get_hsva_f(&self) -> (f64, f64, f64, f64)

source

pub fn get_rgba(&self) -> (i32, i32, i32, i32)

Wrapper around getRgbF(qreal *r, qreal *g, qreal *b, qreal *a = nullptr) method.

Wrapper-specific

Returns red, green, blue and alpha components as a tuple, instead of mutable references.

source

pub fn get_rgba_f(&self) -> (f64, f64, f64, f64)

source

pub fn green(&self) -> i32

source

pub fn green_f(&self) -> f64

source

pub fn hsl_hue(&self) -> i32

source

pub fn hsl_hue_f(&self) -> f64

source

pub fn hsl_saturation(&self) -> i32

source

pub fn hsl_saturation_f(&self) -> f64

source

pub fn hsv_hue(&self) -> i32

source

pub fn hsv_hue_f(&self) -> f64

source

pub fn hsv_saturation(&self) -> i32

source

pub fn hsv_saturation_f(&self) -> f64

source

pub fn is_valid(&self) -> bool

source

pub fn lighter(&self, factor: Option<i32>) -> QColor

source

pub fn lightness(&self) -> i32

source

pub fn lightness_f(&self) -> f64

source

pub fn magenta(&self) -> i32

source

pub fn magenta_f(&self) -> f64

source

pub fn name(&self) -> QString

source

pub fn name_with_format(&self, format: QColorNameFormat) -> QString

source

pub fn red(&self) -> i32

source

pub fn red_f(&self) -> f64

source

pub fn rgb(&self) -> QRgb

source

pub fn rgba64(&self) -> QRgba64

source

pub fn rgba(&self) -> QRgb

source

pub fn set_alpha(&mut self, alpha: i32)

source

pub fn set_alpha_f(&mut self, alpha: f64)

source

pub fn set_blue(&mut self, blue: i32)

source

pub fn set_blue_f(&mut self, blue: f64)

source

pub fn set_cmyk(&mut self, c: i32, m: i32, y: i32, k: i32, a: Option<i32>)

source

pub fn set_cmyk_f(&mut self, c: f64, m: f64, y: f64, k: f64, a: Option<f64>)

source

pub fn set_green(&mut self, green: i32)

source

pub fn set_green_f(&mut self, green: f64)

source

pub fn set_hsl(&mut self, h: i32, s: i32, l: i32, a: Option<i32>)

source

pub fn set_hsl_f(&mut self, h: f64, s: f64, l: f64, a: Option<f64>)

source

pub fn set_hsv(&mut self, h: i32, s: i32, v: i32, a: Option<i32>)

source

pub fn set_hsv_f(&mut self, h: f64, s: f64, v: f64, a: Option<f64>)

source

pub fn set_named_color(&mut self, name: &str)

source

pub fn set_red(&mut self, red: i32)

source

pub fn set_red_f(&mut self, red: f64)

source

pub fn set_rgb(&mut self, r: i32, g: i32, b: i32, a: Option<i32>)

source

pub fn set_qrgb(&mut self, rgb: QRgb)

source

pub fn set_rgba_64(&mut self, rgba: QRgba64)

source

pub fn set_rgb_f(&mut self, r: f64, g: f64, b: f64, a: Option<f64>)

source

pub fn set_rgba(&mut self, rgba: QRgb)

source

pub fn spec(&self) -> QColorSpec

source

pub fn to_cmyk(&self) -> QColor

source

pub fn to_hsl(&self) -> QColor

source

pub fn to_hsv(&self) -> QColor

source

pub fn to_rgb(&self) -> QColor

source

pub fn value(&self) -> i32

source

pub fn value_f(&self) -> f64

source

pub fn yellow(&self) -> i32

source

pub fn yellow_f(&self) -> f64

Trait Implementations§

source§

impl Clone for QColor

source§

fn clone(&self) -> QColor

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for QColor

source§

fn default() -> QColor

Returns the “default value” for a type. Read more
source§

impl PartialEq for QColor

source§

fn eq(&self, other: &QColor) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl QMetaType for QColor

source§

fn register(_name: Option<&CStr>) -> i32

Registers the type. Read more
source§

fn id() -> i32

source§

fn to_qvariant(&self) -> QVariant

Returns a QVariant containing a copy of this object
source§

fn from_qvariant(variant: QVariant) -> Option<Self>

Attempt to convert from a QVariant to this type.
source§

const CONVERSION_TO_STRING: Option<fn(_: &Self) -> QString> = None

If this is set to a function, it enable the conversion to and from QString
source§

const CONVERSION_FROM_STRING: Option<fn(_: &QString) -> Self> = None

source§

impl Copy for QColor

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> PropertyType for T
where T: QMetaType,

source§

fn register_type(name: &CStr) -> i32

source§

unsafe fn pass_to_qt(&mut self, a: *mut c_void)

source§

unsafe fn read_from_qt(a: *const c_void) -> T

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.