Skip to content

Colors

A class that defines the color scheme for a theme as well as provides several static methods for manipulating colors.

A Colors object is attached to a ThemeDefinition and can also be accessed through the Style.colors property for the current theme.

Examples:

```python
style = Style()

# dot-notation
style.colors.primary

# get method
style.colors.get('primary')
```

This class is an iterator, so you can iterate over the main
style color labels (primary, secondary, success, info, warning,
danger):

```python
for color_label in style.colors:
    color = style.colors.get(color_label)
    print(color_label, color)
```

If, for some reason, you need to iterate over all theme color
labels, then you can use the `Colors.label_iter` method. This
will include all theme colors.

```python
for color_label in style.colors.label_iter():
    color = Colors.get(color_label)
    print(color_label, color)
```

If you want to adjust the hsv values of an existing color by a
specific percentage (delta), you can use the `Colors.update_hsv`
method, which is static. In the example below, the "value delta"
or `vd` is increased by 15%, which will lighten the color:

```python
Colors.update_hsv("#9954bb", vd=0.15)
```
Source code in src/ttkbootstrap/style.py
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
class Colors:
    """A class that defines the color scheme for a theme as well as
    provides several static methods for manipulating colors.

    A `Colors` object is attached to a `ThemeDefinition` and can also
    be accessed through the `Style.colors` property for the
    current theme.

    Examples:

        ```python
        style = Style()

        # dot-notation
        style.colors.primary

        # get method
        style.colors.get('primary')
        ```

        This class is an iterator, so you can iterate over the main
        style color labels (primary, secondary, success, info, warning,
        danger):

        ```python
        for color_label in style.colors:
            color = style.colors.get(color_label)
            print(color_label, color)
        ```

        If, for some reason, you need to iterate over all theme color
        labels, then you can use the `Colors.label_iter` method. This
        will include all theme colors.

        ```python
        for color_label in style.colors.label_iter():
            color = Colors.get(color_label)
            print(color_label, color)
        ```

        If you want to adjust the hsv values of an existing color by a
        specific percentage (delta), you can use the `Colors.update_hsv`
        method, which is static. In the example below, the "value delta"
        or `vd` is increased by 15%, which will lighten the color:

        ```python
        Colors.update_hsv("#9954bb", vd=0.15)
        ```
    """

    def __init__(
            self,
            primary,
            secondary,
            success,
            info,
            warning,
            danger,
            light,
            dark,
            bg,
            fg,
            selectbg,
            selectfg,
            border,
            inputfg,
            inputbg,
            active,
    ):
        """
        Parameters:

            primary (str):
                The primary theme color; used by default for all widgets.

            secondary (str):
                An accent color; commonly of a `grey` hue.

            success (str):
                An accent color; commonly of a `green` hue.

            info (str):
                An accent color; commonly of a `blue` hue.

            warning (str):
                An accent color; commonly of an `orange` hue.

            danger (str):
                An accent color; commonly of a `red` hue.

            light (str):
                An accent color.

            dark (str):
                An accent color.

            bg (str):
                Background color.

            fg (str):
                Default text color.

            selectfg (str):
                The color of selected text.

            selectbg (str):
                The background color of selected text.

            border (str):
                The color used for widget borders.

            inputfg (str):
                The text color for input widgets.

            inputbg (str):
                The text background color for input widgets.

            active (str):
                An accent color.
        """
        self.primary = primary
        self.secondary = secondary
        self.success = success
        self.info = info
        self.warning = warning
        self.danger = danger
        self.light = light
        self.dark = dark
        self.bg = bg
        self.fg = fg
        self.selectbg = selectbg
        self.selectfg = selectfg
        self.border = border
        self.inputfg = inputfg
        self.inputbg = inputbg
        self.active = active

    @staticmethod
    def make_transparent(alpha, foreground, background='#ffffff'):
        """Simulate color transparency.

        Parameters:

            alpha (float):
                The amount of transparency; a number between 0 and 1.

            foreground (str):
                The foreground color.

            background (str):
                The background color.

        Returns:

            str:
                A hexadecimal color representing the "transparent" 
                version of the foreground color against the background 
                color.
        """
        fg = ImageColor.getrgb(foreground)
        bg = ImageColor.getrgb(background)
        rgb_float = [alpha * c1 + (1 - alpha) * c2 for (c1, c2) in zip(fg, bg)]
        rgb_int = [int(x) for x in rgb_float]
        return '#{:02x}{:02x}{:02x}'.format(*rgb_int)

    @staticmethod
    def rgb_to_hsv(r, g, b):
        """Convert an rgb to hsv color value.

        Parameters:
            r (float):
                red
            g (float):
                green
            b (float):
                blue

        Returns:
            tuple[float, float, float]: The hsv color value.
        """
        return colorsys.rgb_to_hsv(r, g, b)

    def get_luminance(self, color):
        """Calculate the luminance of a color.

        Parameters:
            color (str):
                A hexadecimal color value.
        Returns:
            float:
                The luminance value of the color.
        """
        r, g, b = self.hex_to_rgb(color)

        # Convert RGB to linear RGB
        r = self._get_luminance_value(r)
        g = self._get_luminance_value(g)
        b = self._get_luminance_value(b)

        # Calculate luminance using the WCAG formula
        return 0.2126 * r + 0.7152 * g + 0.0722 * b

    def _get_luminance_value(self, value):
        if value <= 0.03928:
            return value / 12.92
        else:
            return ((value + 0.055) / 1.055) ** 2.4

    def get_contrast_ration(self, lum1, lum2):
        """Calculate the contrast ratio between two luminance values.

        Parameters:
            lum1 (float):
                The first luminance value.
            lum2 (float):
                The second luminance value.

        Returns:
            float:
                The contrast ratio.
        """
        if lum1 > lum2:
            return (lum1 + 0.05) / (lum2 + 0.05)
        else:
            return (lum2 + 0.05) / (lum1 + 0.05)

    def get_foreground(self, color_label):
        """Return the appropriate foreground color for the specified
        color_label.

        Parameters:
            color_label (str):
                A color label corresponding to a class property

        Returns:
            str:
                A hexadecimal color value for the foreground color.

        Raises:
            TypeError: If the color_label is not a valid color property.
        """
        if color_label == LIGHT:
            return self.dark
        elif color_label == DARK:
            return self.light

        if not Style().dynamic_foreground:
            return self.selectfg

        # dynamic foreground selection
        contrast_with_fg = self.get_contrast_ration(
            self.get_luminance(self.get(color_label)), self.get_luminance(self.fg)
        )
        contrast_with_selectfg = self.get_contrast_ration(
            self.get_luminance(self.get(color_label)), self.get_luminance(self.selectfg)
        )

        if contrast_with_fg > contrast_with_selectfg:
            return self.fg
        return self.selectfg

    def get(self, color_label: str):
        """Lookup a color value from the color name

        Parameters:

            color_label (str):
                A color label corresponding to a class propery

        Returns:

            str:
                A hexadecimal color value.
        """
        return self.__dict__.get(color_label)

    def set(self, color_label: str, color_value: str):
        """Set a color property value. This does not update any existing
        widgets. Can also be used to create on-demand color properties
        that can be used in your program after creation.

        Parameters:

            color_label (str):
                The name of the color to be set (key)

            color_value (str):
                A hexadecimal color value
        """
        self.__dict__[color_label] = color_value

    def __iter__(self):
        return iter(
            [
                "primary",
                "secondary",
                "success",
                "info",
                "warning",
                "danger",
                "light",
                "dark",
            ]
        )

    def __repr__(self):
        out = tuple(zip(self.__dict__.keys(), self.__dict__.values()))
        return str(out)

    @staticmethod
    def label_iter():
        """Iterate over all color label properties in the Color class

        Returns:

            iter:
                An iterator for color label names
        """
        return iter(
            [
                "primary",
                "secondary",
                "success",
                "info",
                "warning",
                "danger",
                "light",
                "dark",
                "bg",
                "fg",
                "selectbg",
                "selectfg",
                "border",
                "inputfg",
                "inputbg",
                "active",
            ]
        )

    @staticmethod
    def hex_to_rgb(color: str):
        """Convert hexadecimal color to rgb color value

        Parameters:

            color (str):
                A hexadecimal color value

        Returns:

            tuple[int, int, int]:
                An rgb color value.
        """
        r, g, b = colorutils.color_to_rgb(color)
        return r / 255, g / 255, b / 255

    @staticmethod
    def rgb_to_hex(r: int, g: int, b: int):
        """Convert rgb to hexadecimal color value

        Parameters:

            r (int):
                red

            g (int):
                green

            b (int):
                blue

        Returns:

            str:
                A hexadecimal color value
        """
        r_ = int(r * 255)
        g_ = int(g * 255)
        b_ = int(b * 255)
        return colorutils.color_to_hex((r_, g_, b_))

    @staticmethod
    def update_hsv(color, hd=0, sd=0, vd=0):
        """Modify the hue, saturation, and/or value of a given hex
        color value by specifying the _delta_.

        Parameters:

            color (str):
                A hexadecimal color value to adjust.

            hd (float):
                % change in hue, _hue delta_.

            sd (float):
                % change in saturation, _saturation delta_.

            vd (float):
                % change in value, _value delta_.

        Returns:

            str:
                The resulting hexadecimal color value
        """
        r, g, b = Colors.hex_to_rgb(color)
        h, s, v = colorsys.rgb_to_hsv(r, g, b)

        # hue
        if h * (1 + hd) > 1:
            h = 1
        elif h * (1 + hd) < 0:
            h = 0
        else:
            h *= 1 + hd

        # saturation
        if s * (1 + sd) > 1:
            s = 1
        elif s * (1 + sd) < 0:
            s = 0
        else:
            s *= 1 + sd

        # value
        if v * (1 + vd) > 1:
            v = 0.95
        elif v * (1 + vd) < 0.05:
            v = 0.05
        else:
            v *= 1 + vd

        r, g, b = colorsys.hsv_to_rgb(h, s, v)
        return Colors.rgb_to_hex(r, g, b)

__init__(primary, secondary, success, info, warning, danger, light, dark, bg, fg, selectbg, selectfg, border, inputfg, inputbg, active)

Parameters:

primary (str):
    The primary theme color; used by default for all widgets.

secondary (str):
    An accent color; commonly of a `grey` hue.

success (str):
    An accent color; commonly of a `green` hue.

info (str):
    An accent color; commonly of a `blue` hue.

warning (str):
    An accent color; commonly of an `orange` hue.

danger (str):
    An accent color; commonly of a `red` hue.

light (str):
    An accent color.

dark (str):
    An accent color.

bg (str):
    Background color.

fg (str):
    Default text color.

selectfg (str):
    The color of selected text.

selectbg (str):
    The background color of selected text.

border (str):
    The color used for widget borders.

inputfg (str):
    The text color for input widgets.

inputbg (str):
    The text background color for input widgets.

active (str):
    An accent color.
Source code in src/ttkbootstrap/style.py
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
def __init__(
        self,
        primary,
        secondary,
        success,
        info,
        warning,
        danger,
        light,
        dark,
        bg,
        fg,
        selectbg,
        selectfg,
        border,
        inputfg,
        inputbg,
        active,
):
    """
    Parameters:

        primary (str):
            The primary theme color; used by default for all widgets.

        secondary (str):
            An accent color; commonly of a `grey` hue.

        success (str):
            An accent color; commonly of a `green` hue.

        info (str):
            An accent color; commonly of a `blue` hue.

        warning (str):
            An accent color; commonly of an `orange` hue.

        danger (str):
            An accent color; commonly of a `red` hue.

        light (str):
            An accent color.

        dark (str):
            An accent color.

        bg (str):
            Background color.

        fg (str):
            Default text color.

        selectfg (str):
            The color of selected text.

        selectbg (str):
            The background color of selected text.

        border (str):
            The color used for widget borders.

        inputfg (str):
            The text color for input widgets.

        inputbg (str):
            The text background color for input widgets.

        active (str):
            An accent color.
    """
    self.primary = primary
    self.secondary = secondary
    self.success = success
    self.info = info
    self.warning = warning
    self.danger = danger
    self.light = light
    self.dark = dark
    self.bg = bg
    self.fg = fg
    self.selectbg = selectbg
    self.selectfg = selectfg
    self.border = border
    self.inputfg = inputfg
    self.inputbg = inputbg
    self.active = active

get(color_label)

Lookup a color value from the color name

Parameters:

color_label (str):
    A color label corresponding to a class propery

Returns:

str:
    A hexadecimal color value.
Source code in src/ttkbootstrap/style.py
339
340
341
342
343
344
345
346
347
348
349
350
351
352
def get(self, color_label: str):
    """Lookup a color value from the color name

    Parameters:

        color_label (str):
            A color label corresponding to a class propery

    Returns:

        str:
            A hexadecimal color value.
    """
    return self.__dict__.get(color_label)

get_contrast_ration(lum1, lum2)

Calculate the contrast ratio between two luminance values.

Parameters:

Name Type Description Default
lum1 float

The first luminance value.

required
lum2 float

The second luminance value.

required

Returns:

Name Type Description
float

The contrast ratio.

Source code in src/ttkbootstrap/style.py
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
def get_contrast_ration(self, lum1, lum2):
    """Calculate the contrast ratio between two luminance values.

    Parameters:
        lum1 (float):
            The first luminance value.
        lum2 (float):
            The second luminance value.

    Returns:
        float:
            The contrast ratio.
    """
    if lum1 > lum2:
        return (lum1 + 0.05) / (lum2 + 0.05)
    else:
        return (lum2 + 0.05) / (lum1 + 0.05)

get_foreground(color_label)

Return the appropriate foreground color for the specified color_label.

Parameters:

Name Type Description Default
color_label str

A color label corresponding to a class property

required

Returns:

Name Type Description
str

A hexadecimal color value for the foreground color.

Raises:

Type Description
TypeError

If the color_label is not a valid color property.

Source code in src/ttkbootstrap/style.py
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
def get_foreground(self, color_label):
    """Return the appropriate foreground color for the specified
    color_label.

    Parameters:
        color_label (str):
            A color label corresponding to a class property

    Returns:
        str:
            A hexadecimal color value for the foreground color.

    Raises:
        TypeError: If the color_label is not a valid color property.
    """
    if color_label == LIGHT:
        return self.dark
    elif color_label == DARK:
        return self.light

    if not Style().dynamic_foreground:
        return self.selectfg

    # dynamic foreground selection
    contrast_with_fg = self.get_contrast_ration(
        self.get_luminance(self.get(color_label)), self.get_luminance(self.fg)
    )
    contrast_with_selectfg = self.get_contrast_ration(
        self.get_luminance(self.get(color_label)), self.get_luminance(self.selectfg)
    )

    if contrast_with_fg > contrast_with_selectfg:
        return self.fg
    return self.selectfg

get_luminance(color)

Calculate the luminance of a color.

Parameters:

Name Type Description Default
color str

A hexadecimal color value.

required

Returns: float: The luminance value of the color.

Source code in src/ttkbootstrap/style.py
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
def get_luminance(self, color):
    """Calculate the luminance of a color.

    Parameters:
        color (str):
            A hexadecimal color value.
    Returns:
        float:
            The luminance value of the color.
    """
    r, g, b = self.hex_to_rgb(color)

    # Convert RGB to linear RGB
    r = self._get_luminance_value(r)
    g = self._get_luminance_value(g)
    b = self._get_luminance_value(b)

    # Calculate luminance using the WCAG formula
    return 0.2126 * r + 0.7152 * g + 0.0722 * b

hex_to_rgb(color) staticmethod

Convert hexadecimal color to rgb color value

Parameters:

color (str):
    A hexadecimal color value

Returns:

tuple[int, int, int]:
    An rgb color value.
Source code in src/ttkbootstrap/style.py
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
@staticmethod
def hex_to_rgb(color: str):
    """Convert hexadecimal color to rgb color value

    Parameters:

        color (str):
            A hexadecimal color value

    Returns:

        tuple[int, int, int]:
            An rgb color value.
    """
    r, g, b = colorutils.color_to_rgb(color)
    return r / 255, g / 255, b / 255

label_iter() staticmethod

Iterate over all color label properties in the Color class

Returns:

iter:
    An iterator for color label names
Source code in src/ttkbootstrap/style.py
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
@staticmethod
def label_iter():
    """Iterate over all color label properties in the Color class

    Returns:

        iter:
            An iterator for color label names
    """
    return iter(
        [
            "primary",
            "secondary",
            "success",
            "info",
            "warning",
            "danger",
            "light",
            "dark",
            "bg",
            "fg",
            "selectbg",
            "selectfg",
            "border",
            "inputfg",
            "inputbg",
            "active",
        ]
    )

make_transparent(alpha, foreground, background='#ffffff') staticmethod

Simulate color transparency.

Parameters:

alpha (float):
    The amount of transparency; a number between 0 and 1.

foreground (str):
    The foreground color.

background (str):
    The background color.

Returns:

str:
    A hexadecimal color representing the "transparent" 
    version of the foreground color against the background 
    color.
Source code in src/ttkbootstrap/style.py
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
@staticmethod
def make_transparent(alpha, foreground, background='#ffffff'):
    """Simulate color transparency.

    Parameters:

        alpha (float):
            The amount of transparency; a number between 0 and 1.

        foreground (str):
            The foreground color.

        background (str):
            The background color.

    Returns:

        str:
            A hexadecimal color representing the "transparent" 
            version of the foreground color against the background 
            color.
    """
    fg = ImageColor.getrgb(foreground)
    bg = ImageColor.getrgb(background)
    rgb_float = [alpha * c1 + (1 - alpha) * c2 for (c1, c2) in zip(fg, bg)]
    rgb_int = [int(x) for x in rgb_float]
    return '#{:02x}{:02x}{:02x}'.format(*rgb_int)

rgb_to_hex(r, g, b) staticmethod

Convert rgb to hexadecimal color value

Parameters:

r (int):
    red

g (int):
    green

b (int):
    blue

Returns:

str:
    A hexadecimal color value
Source code in src/ttkbootstrap/style.py
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
@staticmethod
def rgb_to_hex(r: int, g: int, b: int):
    """Convert rgb to hexadecimal color value

    Parameters:

        r (int):
            red

        g (int):
            green

        b (int):
            blue

    Returns:

        str:
            A hexadecimal color value
    """
    r_ = int(r * 255)
    g_ = int(g * 255)
    b_ = int(b * 255)
    return colorutils.color_to_hex((r_, g_, b_))

rgb_to_hsv(r, g, b) staticmethod

Convert an rgb to hsv color value.

Parameters:

Name Type Description Default
r float

red

required
g float

green

required
b float

blue

required

Returns:

Type Description

tuple[float, float, float]: The hsv color value.

Source code in src/ttkbootstrap/style.py
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
@staticmethod
def rgb_to_hsv(r, g, b):
    """Convert an rgb to hsv color value.

    Parameters:
        r (float):
            red
        g (float):
            green
        b (float):
            blue

    Returns:
        tuple[float, float, float]: The hsv color value.
    """
    return colorsys.rgb_to_hsv(r, g, b)

set(color_label, color_value)

Set a color property value. This does not update any existing widgets. Can also be used to create on-demand color properties that can be used in your program after creation.

Parameters:

color_label (str):
    The name of the color to be set (key)

color_value (str):
    A hexadecimal color value
Source code in src/ttkbootstrap/style.py
354
355
356
357
358
359
360
361
362
363
364
365
366
367
def set(self, color_label: str, color_value: str):
    """Set a color property value. This does not update any existing
    widgets. Can also be used to create on-demand color properties
    that can be used in your program after creation.

    Parameters:

        color_label (str):
            The name of the color to be set (key)

        color_value (str):
            A hexadecimal color value
    """
    self.__dict__[color_label] = color_value

update_hsv(color, hd=0, sd=0, vd=0) staticmethod

Modify the hue, saturation, and/or value of a given hex color value by specifying the delta.

Parameters:

color (str):
    A hexadecimal color value to adjust.

hd (float):
    % change in hue, _hue delta_.

sd (float):
    % change in saturation, _saturation delta_.

vd (float):
    % change in value, _value delta_.

Returns:

str:
    The resulting hexadecimal color value
Source code in src/ttkbootstrap/style.py
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
@staticmethod
def update_hsv(color, hd=0, sd=0, vd=0):
    """Modify the hue, saturation, and/or value of a given hex
    color value by specifying the _delta_.

    Parameters:

        color (str):
            A hexadecimal color value to adjust.

        hd (float):
            % change in hue, _hue delta_.

        sd (float):
            % change in saturation, _saturation delta_.

        vd (float):
            % change in value, _value delta_.

    Returns:

        str:
            The resulting hexadecimal color value
    """
    r, g, b = Colors.hex_to_rgb(color)
    h, s, v = colorsys.rgb_to_hsv(r, g, b)

    # hue
    if h * (1 + hd) > 1:
        h = 1
    elif h * (1 + hd) < 0:
        h = 0
    else:
        h *= 1 + hd

    # saturation
    if s * (1 + sd) > 1:
        s = 1
    elif s * (1 + sd) < 0:
        s = 0
    else:
        s *= 1 + sd

    # value
    if v * (1 + vd) > 1:
        v = 0.95
    elif v * (1 + vd) < 0.05:
        v = 0.05
    else:
        v *= 1 + vd

    r, g, b = colorsys.hsv_to_rgb(h, s, v)
    return Colors.rgb_to_hex(r, g, b)