Fluid
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Color Class Reference

Utility functions for colors. More...

#include <color.h>

Inheritance diagram for Color:
Inheritance graph
[legend]
Collaboration diagram for Color:
Collaboration graph
[legend]

Public Member Functions

 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 Public Member Functions

static Colorcreate (QQmlEngine *engine, QJSEngine *jsEngine)
 

Detailed Description

Utility functions for colors.

Utility functions to manipulate colors.

Constructor & Destructor Documentation

◆ Color()

Color::Color ( QObject *  parent = nullptr)
explicit

Member Function Documentation

◆ 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: