Struct qmetaobject::QColor
source · #[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) -> QColor
pub fn from_name(name: &str) -> QColor
Wrapper around QColor(QLatin1String)
constructor.
sourcepub fn from_global_color(color: QGlobalColor) -> QColor
pub fn from_global_color(color: QGlobalColor) -> QColor
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: f64, m: f64, y: f64, k: f64) -> QColor
pub fn from_cmyka_f(c: f64, m: f64, y: f64, k: f64, a: f64) -> 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: f64, s: f64, l: f64) -> QColor
pub fn from_hsla_f(h: f64, s: f64, l: f64, a: f64) -> 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: f64, s: f64, v: f64) -> QColor
pub fn from_hsva_f(h: f64, s: f64, v: f64, a: f64) -> 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: f64, g: f64, b: f64) -> QColor
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
.
sourcepub fn from_rgba_f(r: f64, g: f64, b: f64, a: f64) -> QColor
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
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) -> f64
pub fn black(&self) -> i32
pub fn black_f(&self) -> f64
pub fn blue(&self) -> i32
pub fn blue_f(&self) -> f64
pub fn convert_to(&self, color_spec: QColorSpec) -> QColor
pub fn cyan(&self) -> i32
pub fn cyan_f(&self) -> f64
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) -> (f64, f64, f64, f64, f64)
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);
pub fn get_hsla(&self) -> (i32, i32, i32, i32)
pub fn get_hsla_f(&self) -> (f64, f64, f64, f64)
pub fn get_hsva(&self) -> (i32, i32, i32, i32)
pub fn get_hsva_f(&self) -> (f64, f64, f64, f64)
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.