Fluid 1.3.0
Material Design for QtQuick and Qml
Loading...
Searching...
No Matches
Color Class Reference

Utility functions for colors. More...

#include <color.h>

Inheritance diagram for Color:

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.

Definition at line 15 of file color.h.

Constructor & Destructor Documentation

◆ Color()

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

Definition at line 6 of file color.cpp.

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.

Definition at line 17 of file color.cpp.

◆ create()

Color * Color::create ( QQmlEngine *  engine,
QJSEngine *  jsEngine 
)
static

Definition at line 42 of file color.cpp.

◆ isDarkColor()

bool Color::isDarkColor ( const QColor &  color)

Returns true if color is dark and should have light content on top.

Definition at line 31 of file color.cpp.

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

Definition at line 37 of file color.cpp.

◆ luminance()

qreal Color::luminance ( const QColor &  color)

Calculate luminance of color.

Definition at line 26 of file color.cpp.

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

Definition at line 11 of file color.cpp.


The documentation for this class was generated from the following files: