Hint

Refer to QMK’s documentation for details on how to use community modules

colors

Custom type to define colors in different ways.

enum color_type_t
[source]

Different ways in which a color can be specified.

enumerator COLOR_TYPE_RGB
[source]
enumerator COLOR_TYPE_HSV
[source]
enumerator COLOR_TYPE_HUE
[source]

Color of a specific hue, whose saturation and value follow RGB matrix’s settings.

enumerator COLOR_TYPE_TRNS
[source]

Transparency, used for falling back into another color.

Note

The color “below” has to be computed by other code based on context. This type of value stores no color information.

enumerator COLOR_TYPE_WHITE
[source]

White color whose brightness (val) follows RGB matrix’s settings.

struct color_t
[source]

Represent colors in different ways.

color_type_t type
[source]

How this color is specified: rgb, hsv, just hue, …

union [anonymous]
[source]

Inner value.

rgb_t rgb
[source]
hsv_t hsv
[source]
RGB_COLOR(_rgb...)
[source]

Create a color_t instance from a RGB triplet.

HSV_COLOR(_hsv...)
[source]

Create a color_t instance from a HSV triplet.

enum qmk_hues
[source]

Hue values for QMK builtin colors.

enumerator HUE_AZURE = 132
[source]
enumerator HUE_BLUE = 170
[source]
enumerator HUE_CHARTREUSE = 64
[source]
enumerator HUE_CORAL = 11
[source]
enumerator HUE_CYAN = 128
[source]
enumerator HUE_GOLD = 36
[source]
enumerator HUE_GOLDENROD = 30
[source]
enumerator HUE_GREEN = 85
[source]
enumerator HUE_MAGENTA = 213
[source]
enumerator HUE_ORANGE = 21
[source]
enumerator HUE_PINK = 234
[source]
enumerator HUE_PURPLE = 191
[source]
enumerator HUE_RED = 0
[source]
enumerator HUE_SPRINGGREEN = 106
[source]
enumerator HUE_TEAL = 128
[source]
enumerator HUE_TURQUOISE = 123
[source]
enumerator HUE_YELLOW = 43
[source]
HUE(_hue)
[source]

Create a color_t instance from a hue value.

TRNS_COLOR
[source]

Create a color_t instance for transparency.

WHITE_COLOR
[source]

Create a color_t instance for white.

int to_rgb(color_t color, rgb_t *rgb)
[source]

Convert a color_t to RGB format.

Parameters:
  • color – Color definition.

  • rgb – Pointer where the value will be written.

Return: Result of the operation.
  • 0: Color was retrieved.

  • -ENODATA: TRNS was found, there’s nothing to work with.

  • -EINVAL: Invalid value (color.type is not a value in color_type_t).