|
| | Color (const QColor &color) noexcept |
|
| Color (float r, float g, float b, float a=1.0f) noexcept |
| | Color (const std::string &str) |
| | Construct a new Color object by parsing the color string.
|
|
Color & | operator= (const QColor &color) |
|
Color & | brighten (float val) |
| | Brightens the color by the given amount.
|
|
Color & | brighten_default () |
| | Brightens the color by the default amount.
|
|
Color & | darken (float val) |
| | Darkens the color by the given amount.
|
|
Color & | darken_default () |
| | Darkens the color by the default amount.
|
|
bool | is_same (const Color &other) const |
| | Returns whether the color is the same as another.
|
|
bool | is_bright () const |
| | Returns if the color is bright or not.
|
|
bool | is_very_bright () const |
| | Returns if the color is very bright or not.
|
|
bool | is_very_very_bright () const |
| | Returns if the color is very very bright or not.
|
|
bool | is_very_dark () const |
| | Returns if the color is very dark or not.
|
|
bool | is_very_very_dark () const |
| | Returns if the color is very very dark or not.
|
|
Color | get_opposite () const |
| | Gets the opposite color.
|
|
float | get_brightness () const |
| | Gets the brightness of the color.
|
|
float | get_darkness () const |
| | Gets the darkness of the color.
|
| Color | morph (const Color &other, float amt) const |
| | Morphs from this color to another, depending on the given amount.
|
|
Color | get_contrast_color () const |
| | Returns the contrasting color (variation of black or white) based on if the given color is dark enough or not.
|
|
QColor | to_qcolor () const |
| std::string | to_hex () const |
| | Converts the color to a hex string.
|
|
| static Color | get_mid_color (const Color &c1, const Color &c2, const float transition=0.5f) |
| | Returns the color in-between two colors.
|
| static Color | get_arranger_object_color (const Color &color, bool is_hovered, bool is_selected, bool is_transient, bool is_muted) |
| | Gets the color the widget should be.
|
|
static std::string | rgb_to_hex (float r, float g, float b) |
|
|
bool | operator== (const Color &lhs, const Color &rhs) |
Definition at line 15 of file color.h.
◆ Color() [1/2]
| zrythm::utils::Color::Color |
( |
const QColor & | color | ) |
|
|
inlinenoexcept |
◆ Color() [2/2]
| zrythm::utils::Color::Color |
( |
const std::string & | str | ) |
|
Construct a new Color object by parsing the color string.
- Parameters
-
◆ get_arranger_object_color()
| Color zrythm::utils::Color::get_arranger_object_color |
( |
const Color & | color, |
|
|
bool | is_hovered, |
|
|
bool | is_selected, |
|
|
bool | is_transient, |
|
|
bool | is_muted ) |
|
static |
Gets the color the widget should be.
- Parameters
-
| color | The original color. |
| is_selected | Whether the widget is supposed to be selected or not. |
◆ get_mid_color()
| Color zrythm::utils::Color::get_mid_color |
( |
const Color & | c1, |
|
|
const Color & | c2, |
|
|
const float | transition = 0.5f ) |
|
static |
Returns the color in-between two colors.
- Parameters
-
| transition | How far to transition (0.5 for half). |
◆ morph()
| Color zrythm::utils::Color::morph |
( |
const Color & | other, |
|
|
float | amt ) const |
|
nodiscard |
Morphs from this color to another, depending on the given amount.
Eg, if amt is 0, the resulting color will be this color. If amt is 1, the resulting color will be other.
◆ to_hex()
| std::string zrythm::utils::Color::to_hex |
( |
| ) |
const |
Converts the color to a hex string.
- Returns
- std::string
◆ alpha_
| float zrythm::utils::Color::alpha_ = 1.0f |
◆ blue_
| float zrythm::utils::Color::blue_ = 0.f |
◆ DEFAULT_BRIGHTEN_VAL
| auto zrythm::utils::Color::DEFAULT_BRIGHTEN_VAL = 0.1f |
|
staticconstexpr |
◆ green_
| float zrythm::utils::Color::green_ = 0.f |
◆ red_
| float zrythm::utils::Color::red_ = 0.f |
The documentation for this class was generated from the following file: