Utility functions for colors.
More...
#include <color.h>
|
| Color (QObject *parent=nullptr) |
|
Q_INVOKABLE QColor | transparent (const QColor &color, qreal alpha) |
|
Q_INVOKABLE QColor | blend (const QColor &color1, const QColor &color2, qreal alpha) |
|
Q_INVOKABLE qreal | luminance (const QColor &color) |
|
Q_INVOKABLE bool | isDarkColor (const QColor &color) |
|
Q_INVOKABLE QColor | lightDark (const QColor &background, const QColor &lightColor, const QColor &darkColor) |
|
|
static Color * | create (QQmlEngine *engine, QJSEngine *jsEngine) |
|
Utility functions for colors.
Utility functions to manipulate colors.
◆ Color()
Color::Color |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
◆ blend()
QColor Color::blend |
( |
const QColor & |
color1, |
|
|
const QColor & |
color2, |
|
|
qreal |
alpha |
|
) |
| |
Blend color1 and color2 together and set alpha to alpha.
◆ create()
Color * Color::create |
( |
QQmlEngine * |
engine, |
|
|
QJSEngine * |
jsEngine |
|
) |
| |
|
static |
◆ isDarkColor()
bool Color::isDarkColor |
( |
const QColor & |
color | ) |
|
Returns true
if color is dark and should have light content on top.
◆ lightDark()
QColor Color::lightDark |
( |
const QColor & |
background, |
|
|
const QColor & |
lightColor, |
|
|
const QColor & |
darkColor |
|
) |
| |
Select a color depending on whether background color is light or dark. Returns lightColor if background is a light color, otherwise returns darkColor.
◆ luminance()
qreal Color::luminance |
( |
const QColor & |
color | ) |
|
Calculate luminance of color.
◆ transparent()
QColor Color::transparent |
( |
const QColor & |
color, |
|
|
qreal |
alpha |
|
) |
| |
A utility method for changing the alpha on color. Returns a new object, and does not modify the original color at all.
The documentation for this class was generated from the following files:
- /home/runner/work/docs/docs/fluid/src/imports/controls/color.h
- /home/runner/work/docs/docs/fluid/src/imports/controls/color.cpp