12#include <kguiaddons_export.h>
31KGUIADDONS_EXPORT qreal
hue(
const QColor &);
41KGUIADDONS_EXPORT qreal
chroma(
const QColor &);
55KGUIADDONS_EXPORT qreal
luma(
const QColor &);
68KGUIADDONS_EXPORT
void getHcy(
const QColor &, qreal *hue, qreal *chroma, qreal *luma, qreal *alpha =
nullptr);
81KGUIADDONS_EXPORT QColor
hcyColor(qreal hue, qreal chroma, qreal luma, qreal alpha = 1.0);
112KGUIADDONS_EXPORT QColor
lighten(
const QColor &, qreal amount = 0.5, qreal chromaInverseGain = 1.0);
129KGUIADDONS_EXPORT QColor
darken(
const QColor &, qreal amount = 0.5, qreal chromaGain = 1.0);
143KGUIADDONS_EXPORT QColor
shade(
const QColor &, qreal lumaAmount, qreal chromaAmount = 0.0);
157KGUIADDONS_EXPORT QColor
tint(
const QColor &base,
const QColor &color, qreal amount = 0.3);
170KGUIADDONS_EXPORT QColor
mix(
const QColor &c1,
const QColor &c2, qreal bias = 0.5);
184KGUIADDONS_EXPORT QColor
overlayColors(
const QColor &base,
const QColor &paint, QPainter::CompositionMode comp = QPainter::CompositionMode_SourceOver);
A set of methods used to work with colors.
Definition kcolorutils.h:22
qreal chroma(const QColor &)
Calculate the chroma of a color.
QColor darken(const QColor &, qreal amount=0.5, qreal chromaGain=1.0)
Adjust the luma of a color by changing its distance from black.
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...
void getHcy(const QColor &, qreal *hue, qreal *chroma, qreal *luma, qreal *alpha=nullptr)
Calculate hue, chroma and luma of a color in one call.
qreal luma(const QColor &)
Calculate the luma of a color.
QColor shade(const QColor &, qreal lumaAmount, qreal chromaAmount=0.0)
Adjust the luma and chroma components of a color.
QColor mix(const QColor &c1, const QColor &c2, qreal bias=0.5)
Blend two colors into a new color by linear combination.
QColor tint(const QColor &base, const QColor &color, qreal amount=0.3)
Create a new color by tinting one color with another.
QColor lighten(const QColor &, qreal amount=0.5, qreal chromaInverseGain=1.0)
Adjust the luma of a color by changing its distance from white.
qreal contrastRatio(const QColor &, const QColor &)
Calculate the contrast ratio between two colors, according to the W3C/WCAG2.0 algorithm,...
qreal hue(const QColor &)
Calculate the hue of a color.
QColor hcyColor(qreal hue, qreal chroma, qreal luma, qreal alpha=1.0)
Return a QColor based on the given hue, chroma, luma and alpha values.