Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
color.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2020-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
11#ifndef __UTILS_COLOR_H__
12#define __UTILS_COLOR_H__
13
14#include <stdbool.h>
15
16#include <gtk/gtk.h>
17
24#define COLOR_DEFAULT_BRIGHTEN_VAL 0.1f
25
29void
30color_brighten (GdkRGBA * src, float val);
31
35void
36color_brighten_default (GdkRGBA * src);
37
41void
42color_darken (GdkRGBA * src, float val);
43
47void
48color_darken_default (GdkRGBA * src);
49
53bool
54color_is_same (GdkRGBA * src, GdkRGBA * dest);
55
59bool
60color_is_bright (GdkRGBA * src);
61
65bool
66color_is_very_bright (GdkRGBA * src);
67
71bool
73
77bool
78color_is_very_dark (GdkRGBA * src);
79
83bool
85
86void
87color_get_opposite (GdkRGBA * src, GdkRGBA * dest);
88
89float
90color_get_brightness (GdkRGBA * color);
91
92float
93color_get_darkness (GdkRGBA * color);
94
102void
103color_morph (GdkRGBA * a, GdkRGBA * b, float amt, GdkRGBA * result);
104
109#endif
void color_darken(GdkRGBA *src, float val)
Darkens the color by the given amount.
bool color_is_very_bright(GdkRGBA *src)
Returns if the color is very bright or not.
bool color_is_same(GdkRGBA *src, GdkRGBA *dest)
Returns whether the color is the same.
bool color_is_bright(GdkRGBA *src)
Returns if the color is bright or not.
void color_brighten_default(GdkRGBA *src)
Brightens the color by the default amount.
bool color_is_very_very_bright(GdkRGBA *src)
Returns if the color is very very bright or not.
bool color_is_very_very_dark(GdkRGBA *src)
Returns if the color is very very dark or not.
void color_brighten(GdkRGBA *src, float val)
Brightens the color by the given amount.
void color_darken_default(GdkRGBA *src)
Darkens the color by the default amount.
void color_morph(GdkRGBA *a, GdkRGBA *b, float amt, GdkRGBA *result)
Morphs from a to b, depending on the given amount.
bool color_is_very_dark(GdkRGBA *src)
Returns if the color is very dark or not.