![]() |
Qt 6.x
The Qt SDK
|
#include "qcolor.h"
#include "qcolor_p.h"
#include "qdrawhelper_p.h"
#include "qfloat16.h"
#include "qnamespace.h"
#include "qdatastream.h"
#include "qvariant.h"
#include "qdebug.h"
#include "private/qtools_p.h"
#include <algorithm>
#include <optional>
#include <stdio.h>
#include <limits.h>
Go to the source code of this file.
Classes | |
struct | RGBData |
Namespaces | |
namespace | QColorConstants |
\inmodule QtGui | |
Macros | |
#define | rgb(r, g, b) (0xff000000 | (r << 16) | (g << 8) | b) |
#define | QCOLOR_INT_RANGE_CHECK(fn, var) |
#define | QCOLOR_REAL_RANGE_CHECK(fn, var) |
#define | QRGB(r, g, b) QRgb(((0xffu << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff))) |
#define | QRGBA(r, g, b, a) QRgb(((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff)) |
#define | Q_MAX_3(a, b, c) ( ( a > b && a > c) ? a : (b > c ? b : c) ) |
#define | Q_MIN_3(a, b, c) ( ( a < b && a < c) ? a : (b < c ? b : c) ) |
Functions | |
static int | hex2int (const char *s, int n) |
static std::optional< QRgba64 > | get_hex_rgb (const char *name, size_t len) |
std::optional< QRgb > | qt_get_hex_rgb (const char *name) |
static std::optional< QRgba64 > | get_hex_rgb (const QChar *str, size_t len) |
static std::optional< QRgba64 > | get_hex_rgb (QAnyStringView name) |
bool | operator< (const char *name, const RGBData &data) |
bool | operator< (const RGBData &data, const char *name) |
static std::optional< QRgb > | get_named_rgb_no_space (const char *name_no_space) |
static std::optional< QRgb > | get_named_rgb (QAnyStringView name) |
static QStringList | get_colornames () |
static qfloat16 & | castF16 (quint16 &v) |
static const qfloat16 & | castF16 (const quint16 &v) |
QDebug | operator<< (QDebug dbg, const QColor &c) |
QDataStream & | operator<< (QDataStream &stream, const QColor &color) |
QDataStream & | operator>> (QDataStream &stream, QColor &color) |
Variables | |
QT_BEGIN_NAMESPACE | |
static constexpr struct RGBData | rgbTbl [] |
static const int | rgbTblSize = sizeof(rgbTbl) / sizeof(RGBData) |
const uint | qt_inv_premul_factor [256] |
Definition at line 2179 of file qcolor.cpp.
Definition at line 2180 of file qcolor.cpp.
#define QCOLOR_INT_RANGE_CHECK | ( | fn, | |
var | |||
) |
Definition at line 581 of file qcolor.cpp.
#define QCOLOR_REAL_RANGE_CHECK | ( | fn, | |
var | |||
) |
#define QRGB | ( | r, | |
g, | |||
b | |||
) | QRgb(((0xffu << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff))) |
#define QRGBA | ( | r, | |
g, | |||
b, | |||
a | |||
) | QRgb(((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff)) |
Definition at line 124 of file qcolor.cpp.
Definition at line 1237 of file qcolor.cpp.
Definition at line 1231 of file qcolor.cpp.
Referenced by QColor::alpha(), QColor::alphaF(), QColor::blueF(), QColor::fromRgbF(), QColor::getRgbF(), QColor::greenF(), QColor::redF(), QColor::setAlpha(), QColor::setAlphaF(), QColor::setBlueF(), QColor::setGreenF(), QColor::setRedF(), QColor::setRgbF(), QColor::toExtendedRgb(), and QColor::toRgb().
|
static |
Definition at line 333 of file qcolor.cpp.
References i, rgbTbl, and rgbTblSize.
Referenced by QColor::colorNames().
|
static |
Definition at line 48 of file qcolor.cpp.
References hex2int(), and qRgba64().
Referenced by QColor::fromString(), get_hex_rgb(), get_hex_rgb(), and qt_get_hex_rgb().
Definition at line 97 of file qcolor.cpp.
References get_hex_rgb(), i, and str.
|
static |
Definition at line 108 of file qcolor.cpp.
References get_hex_rgb().
|
static |
Definition at line 314 of file qcolor.cpp.
References get_named_rgb_no_space(), pos, and QtMiscUtils::toAsciiLower().
Referenced by QColor::fromString().
|
static |
Definition at line 300 of file qcolor.cpp.
References rgbTbl, and rgbTblSize.
Referenced by get_named_rgb().
|
inlinestatic |
If s[0..n] is a valid hex number, returns its integer value, otherwise returns -1.
Definition at line 33 of file qcolor.cpp.
References QtMiscUtils::fromHex().
Referenced by get_hex_rgb().
|
inline |
Definition at line 295 of file qcolor.cpp.
References qstrcmp().
|
inline |
Definition at line 297 of file qcolor.cpp.
References qstrcmp().
|
related |
Definition at line 2977 of file qcolor.cpp.
References rgb.
Definition at line 2947 of file qcolor.cpp.
References QColor::Cmyk, QColor::ExtendedRgb, QColor::Hsl, QColor::Hsv, and QColor::Rgb.
|
related |
Definition at line 3013 of file qcolor.cpp.
References rgb.
std::optional< QRgb > qt_get_hex_rgb | ( | const char * | name | ) |
Definition at line 90 of file qcolor.cpp.
References get_hex_rgb(), and qstrlen().
Referenced by read_xpm_body().
|
related |
Definition at line 25 of file qcolor.cpp.
const uint qt_inv_premul_factor[256] |
Definition at line 3049 of file qcolor.cpp.
Referenced by QColor::qUnpremultiply().
|
static |
Referenced by get_colornames(), and get_named_rgb_no_space().
Definition at line 281 of file qcolor.cpp.
Referenced by get_colornames(), and get_named_rgb_no_space().