## Description
Convert a color value to a hex color string. Processing and py5 store color values in 32 bit integers that are inconvenient for a human to parse. To interpret these values, one can use methods like [](sketch_red), [](sketch_green), and [](sketch_blue) to extract color channel values from the 32 bit integers. This method provides an alternative approach, converting the 32 bit integer into a string such as `'#0F3FF0FF'`. The hex string has 8 hexadecimal values following a `#` character. The first two values represent the red value, the next two green, the next two blue, and the last two alpha. This is consistent with CSS 8 digit hex colors.
Conveniently, the hex color string returned by this method can also be used as parameter for other methods that accept color values. Observe how this is done in the example code.
## Signatures
```python
hex_color(
color: int, # any color value
) -> str
```
Updated on March 06, 2023 02:49:26am UTC