QtBase  v6.3.1
Namespaces | Variables
QColorConstants Namespace Reference

The QColorConstants namespace contains QColor predefined constants. More...

Namespaces

 Svg
 

Variables

constexpr QColor Color0 {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x00 * 0x101}
 
constexpr QColor Color1 {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101}
 
constexpr QColor Black {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x00 * 0x101}
 
constexpr QColor White {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101}
 
constexpr QColor DarkGray {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x80 * 0x101, 0x80 * 0x101}
 
constexpr QColor Gray {QColor::Rgb, 0xff * 0x101, 0xa0 * 0x101, 0xa0 * 0x101, 0xa4 * 0x101}
 
constexpr QColor LightGray {QColor::Rgb, 0xff * 0x101, 0xc0 * 0x101, 0xc0 * 0x101, 0xc0 * 0x101}
 
constexpr QColor Red {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101}
 
constexpr QColor Green {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0xff * 0x101, 0x00 * 0x101}
 
constexpr QColor Blue {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0xff * 0x101}
 
constexpr QColor Cyan {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0xff * 0x101, 0xff * 0x101}
 
constexpr QColor Magenta {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0x00 * 0x101, 0xff * 0x101}
 
constexpr QColor Yellow {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101, 0x00 * 0x101}
 
constexpr QColor DarkRed {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x00 * 0x101, 0x00 * 0x101}
 
constexpr QColor DarkGreen {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x80 * 0x101, 0x00 * 0x101}
 
constexpr QColor DarkBlue {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x80 * 0x101}
 
constexpr QColor DarkCyan {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x80 * 0x101, 0x80 * 0x101}
 
constexpr QColor DarkMagenta {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x00 * 0x101, 0x80 * 0x101}
 
constexpr QColor DarkYellow {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x80 * 0x101, 0x00 * 0x101}
 
constexpr QColor Transparent {QColor::Rgb, 0x00 * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x00 * 0x101}
 

Detailed Description

The QColorConstants namespace contains QColor predefined constants.

\inmodule QtGui

Since
5.14

These constants are usable everywhere a QColor object is expected:

void setBrush(const QBrush &brush)
Definition: qpainter.cpp:3755
constexpr QColor lightblue
Definition: qcolor.h:403
QPainter painter(this)
[7]

Their usage is much cheaper than e.g. passing a string to QColor's constructor, as they don't require any parsing of the string, and always result in a valid QColor object:

\badcode object.setColor(QColor("lightblue")); // expensive

Variable Documentation

◆ Black

constexpr QColor QColorConstants::Black {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x00 * 0x101}
inlineconstexpr

Definition at line 315 of file qcolor.h.

◆ Blue

constexpr QColor QColorConstants::Blue {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0xff * 0x101}
inlineconstexpr

Definition at line 322 of file qcolor.h.

◆ Color0

constexpr QColor QColorConstants::Color0 {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x00 * 0x101}
inlineconstexpr

Definition at line 313 of file qcolor.h.

◆ Color1

constexpr QColor QColorConstants::Color1 {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101}
inlineconstexpr

Definition at line 314 of file qcolor.h.

◆ Cyan

constexpr QColor QColorConstants::Cyan {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0xff * 0x101, 0xff * 0x101}
inlineconstexpr

Definition at line 323 of file qcolor.h.

◆ DarkBlue

constexpr QColor QColorConstants::DarkBlue {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x80 * 0x101}
inlineconstexpr

Definition at line 328 of file qcolor.h.

◆ DarkCyan

constexpr QColor QColorConstants::DarkCyan {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x80 * 0x101, 0x80 * 0x101}
inlineconstexpr

Definition at line 329 of file qcolor.h.

◆ DarkGray

constexpr QColor QColorConstants::DarkGray {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x80 * 0x101, 0x80 * 0x101}
inlineconstexpr

Definition at line 317 of file qcolor.h.

◆ DarkGreen

constexpr QColor QColorConstants::DarkGreen {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x80 * 0x101, 0x00 * 0x101}
inlineconstexpr

Definition at line 327 of file qcolor.h.

◆ DarkMagenta

constexpr QColor QColorConstants::DarkMagenta {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x00 * 0x101, 0x80 * 0x101}
inlineconstexpr

Definition at line 330 of file qcolor.h.

◆ DarkRed

constexpr QColor QColorConstants::DarkRed {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x00 * 0x101, 0x00 * 0x101}
inlineconstexpr

Definition at line 326 of file qcolor.h.

◆ DarkYellow

constexpr QColor QColorConstants::DarkYellow {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x80 * 0x101, 0x00 * 0x101}
inlineconstexpr

Definition at line 331 of file qcolor.h.

◆ Gray

constexpr QColor QColorConstants::Gray {QColor::Rgb, 0xff * 0x101, 0xa0 * 0x101, 0xa0 * 0x101, 0xa4 * 0x101}
inlineconstexpr

Definition at line 318 of file qcolor.h.

◆ Green

constexpr QColor QColorConstants::Green {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0xff * 0x101, 0x00 * 0x101}
inlineconstexpr

Definition at line 321 of file qcolor.h.

◆ LightGray

constexpr QColor QColorConstants::LightGray {QColor::Rgb, 0xff * 0x101, 0xc0 * 0x101, 0xc0 * 0x101, 0xc0 * 0x101}
inlineconstexpr

Definition at line 319 of file qcolor.h.

◆ Magenta

constexpr QColor QColorConstants::Magenta {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0x00 * 0x101, 0xff * 0x101}
inlineconstexpr

Definition at line 324 of file qcolor.h.

◆ Red

constexpr QColor QColorConstants::Red {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101}
inlineconstexpr

Definition at line 320 of file qcolor.h.

◆ Transparent

constexpr QColor QColorConstants::Transparent {QColor::Rgb, 0x00 * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x00 * 0x101}
inlineconstexpr

Definition at line 332 of file qcolor.h.

◆ White

constexpr QColor QColorConstants::White {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101}
inlineconstexpr

Definition at line 316 of file qcolor.h.

◆ Yellow

constexpr QColor QColorConstants::Yellow {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101, 0x00 * 0x101}
inlineconstexpr

Definition at line 325 of file qcolor.h.