#[repr(C)]pub struct QColor { /* private fields */ }
Expand description
Wrapper around QColor
class.
Implementations§
source§impl QColor
impl QColor
sourcepub fn from_name(name: &str) -> Self
pub fn from_name(name: &str) -> Self
Wrapper around QColor(QLatin1String)
constructor.
sourcepub fn from_global_color(color: QGlobalColor) -> Self
pub fn from_global_color(color: QGlobalColor) -> Self
Wrapper around QColor(Qt::GlobalColor)
constructor.
pub fn from_cmyk(c: i32, m: i32, y: i32, k: i32) -> QColor
pub fn from_cmyka(c: i32, m: i32, y: i32, k: i32, a: i32) -> QColor
pub fn from_cmyk_f(c: qreal, m: qreal, y: qreal, k: qreal) -> QColor
pub fn from_cmyka_f(c: qreal, m: qreal, y: qreal, k: qreal, a: qreal) -> QColor
pub fn from_hsl(h: i32, s: i32, l: i32) -> QColor
pub fn from_hsla(h: i32, s: i32, l: i32, a: i32) -> QColor
pub fn from_hsl_f(h: qreal, s: qreal, l: qreal) -> QColor
pub fn from_hsla_f(h: qreal, s: qreal, l: qreal, a: qreal) -> QColor
pub fn from_hsv(h: i32, s: i32, v: i32) -> QColor
pub fn from_hsva(h: i32, s: i32, v: i32, a: i32) -> QColor
pub fn from_hsv_f(h: qreal, s: qreal, v: qreal) -> QColor
pub fn from_hsva_f(h: qreal, s: qreal, v: qreal, a: qreal) -> QColor
pub fn from_rgb(r: i32, g: i32, b: i32) -> QColor
pub fn from_rgba(r: i32, g: i32, b: i32, a: i32) -> QColor
sourcepub fn from_rgb_f(r: qreal, g: qreal, b: qreal) -> QColor
pub fn from_rgb_f(r: qreal, g: qreal, b: qreal) -> 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
.
sourcepub fn from_rgba_f(r: qreal, g: qreal, b: qreal, a: qreal) -> Self
pub fn from_rgba_f(r: qreal, g: qreal, b: qreal, a: qreal) -> Self
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
pub fn from_rgb64(r: u16, g: u16, b: u16) -> QColor
pub fn from_rgba64(r: u16, g: u16, b: u16, a: u16) -> QColor
pub fn from_qrgba64(rgba64: QRgba64) -> QColor
pub fn from_qrgb(rgb: QRgb) -> QColor
pub fn is_valid_color(name: &str) -> bool
pub fn alpha(&self) -> i32
pub fn alpha_f(&self) -> qreal
pub fn black(&self) -> i32
pub fn black_f(&self) -> qreal
pub fn blue(&self) -> i32
pub fn blue_f(&self) -> qreal
pub fn convert_to(&self, color_spec: QColorSpec) -> QColor
pub fn cyan(&self) -> i32
pub fn cyan_f(&self) -> qreal
pub fn darker(&self, factor: Option<i32>) -> QColor
sourcepub fn get_cmyka(&mut self) -> (i32, i32, i32, i32, i32)
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);
sourcepub fn get_cmyka_f(&mut self) -> (qreal, qreal, qreal, qreal, qreal)
pub fn get_cmyka_f(&mut self) -> (qreal, qreal, qreal, qreal, qreal)
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);
pub fn get_hsla(&self) -> (i32, i32, i32, i32)
pub fn get_hsla_f(&self) -> (qreal, qreal, qreal, qreal)
pub fn get_hsva(&self) -> (i32, i32, i32, i32)
pub fn get_hsva_f(&self) -> (qreal, qreal, qreal, qreal)
sourcepub fn get_rgba(&self) -> (i32, i32, i32, i32)
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.