KDEUI
kcolorutils.cpp
Go to the documentation of this file.
QColor darken(const QColor &, qreal amount=0.5, qreal chromaGain=1.0)
Adjust the luma of a color by changing its distance from black.
Definition: kcolorutils.cpp:63
bool end()
static QColor tintHelper(const QColor &base, qreal baseLuma, const QColor &color, qreal amount)
Definition: kcolorutils.cpp:79
void fillRect(const QRectF &rectangle, const QBrush &brush)
void setCompositionMode(CompositionMode mode)
qreal alphaF() const
qreal contrastRatio(const QColor &, const QColor &)
Calculate the contrast ratio between two colors, according to the W3C/WCAG2.0 algorithm, (Lmax + 0.05)/(Lmin + 0.05), where Lmax and Lmin are the luma values of the lighter color and the darker color, respectively.
Definition: kcolorutils.cpp:50
qreal redF() const
Definition: kcolorspaces.h:34
qreal blueF() const
QColor tint(const QColor &base, const QColor &color, qreal amount=0.3)
Create a new color by tinting one color with another.
Definition: kcolorutils.cpp:87
QColor mix(const QColor &c1, const QColor &c2, qreal bias=0.5)
Blend two colors into a new color by linear combination.
Definition: kcolorutils.cpp:110
void setAlpha(int alpha)
QColor lighten(const QColor &, qreal amount=0.5, qreal chromaInverseGain=1.0)
Adjust the luma of a color by changing its distance from white.
Definition: kcolorutils.cpp:55
QRgb pixel(int x, int y) const
qreal greenF() const
QColor shade(const QColor &, qreal lumaAmount, qreal chromaAmount=0.0)
Adjust the luma and chroma components of a color.
Definition: kcolorutils.cpp:71
QColor fromRgbF(qreal r, qreal g, qreal b, qreal a)
QColor overlayColors(const QColor &base, const QColor &paint, QPainter::CompositionMode comp=QPainter::CompositionMode_SourceOver)
Blend two colors into a new color by painting the second color over the first using the specified com...
Definition: kcolorutils.cpp:124
static qreal contrastRatioForLuma(qreal y1, qreal y2)
Definition: kcolorutils.cpp:42
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.