Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QColorConstants Namespace Reference

\inmodule QtGui More...

Namespaces

namespace  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

\inmodule QtGui

Since
5.14

The QColorConstants namespace contains QColor predefined constants.

These constants are usable everywhere a QColor object is expected:

void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
constexpr QColor lightblue
Definition qcolor.h:381
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 293 of file qcolor.h.

Referenced by QGradient::stops().

◆ Blue

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

Definition at line 300 of file qcolor.h.

◆ Color0

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

Definition at line 291 of file qcolor.h.

◆ Color1

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

Definition at line 292 of file qcolor.h.

◆ Cyan

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

Definition at line 301 of file qcolor.h.

◆ DarkBlue

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

Definition at line 306 of file qcolor.h.

◆ DarkCyan

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

Definition at line 307 of file qcolor.h.

◆ DarkGray

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

Definition at line 295 of file qcolor.h.

◆ DarkGreen

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

Definition at line 305 of file qcolor.h.

◆ DarkMagenta

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

Definition at line 308 of file qcolor.h.

◆ DarkRed

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

Definition at line 304 of file qcolor.h.

◆ DarkYellow

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

Definition at line 309 of file qcolor.h.

◆ Gray

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

Definition at line 296 of file qcolor.h.

◆ Green

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

Definition at line 299 of file qcolor.h.

◆ LightGray

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

Definition at line 297 of file qcolor.h.

◆ Magenta

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

Definition at line 302 of file qcolor.h.

◆ Red

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

Definition at line 298 of file qcolor.h.

◆ Transparent

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

◆ White

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

Definition at line 294 of file qcolor.h.

Referenced by QGradient::stops().

◆ Yellow

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

Definition at line 303 of file qcolor.h.