From 72c0fdd05f20e293cb9132ebd019f0143bcca56c Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Sun, 12 Mar 2023 21:26:34 +0100 Subject: [PATCH] Feat: add hex color (#2731) --- components/display/index.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/components/display/index.rst b/components/display/index.rst index 6994b0878..b33c68598 100644 --- a/components/display/index.rst +++ b/components/display/index.rst @@ -465,13 +465,36 @@ A ``color`` component exists for just this purpose: blue: 25% white: 0% +Alternatively, you can use ``_int`` to specify the color as an int value: + +.. code-block:: yaml + + color: + - id: my_light_red + red_int: 255 + green_int: 51 + blue_int: 64 + white_int: 0 + +Or, if you are more comforatble with hex values, you can use ``hex``: + +.. code-block:: yaml + + color: + - id: my_light_red + hex: FF3340 Configuration variables: - **red** (*Optional*, percentage): The percentage of the red component. Defaults to ``100%``. +- **red_int** (*Optional*, integer): The brightness of the red component on a scale of ``0`` to ``255``. Defaults to ``255``. - **green** (*Optional*, percentage): The percentage of the green component. Defaults to ``100%``. +- **green_int** (*Optional*, integer): The brightness of the green component on a scale of ``0`` to ``255``. Defaults to ``255``. - **blue** (*Optional*, percentage): The percentage of the blue component. Defaults to ``100%``. +- **blue_int** (*Optional*, integer): The brightness of the blue component on a scale of ``0`` to ``255``. Defaults to ``255``. - **white** (*Optional*, percentage): The percentage of the white component. Defaults to ``100%``. +- **white_int** (*Optional*, integer): The brightness of the white component on a scale of ``0`` to ``255``. Defaults to ``255``. +- **hex** (*Optional*, string): The color in hexadecimal representation. Defaults to ``FFFFFF``. RGB displays use red, green, and blue, while grayscale displays may use white.