> For the complete documentation index, see [llms.txt](https://easy-draw.joemazzone.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://easy-draw.joemazzone.net/python/module-reference/colors.md).

# Colors

There are 3 ways you can use colors in Easy Draw:

## 1. Name of the Color

The easiest way to represent a color is by using the color's name in a string.

Examples:

```python
color = "red"
color = "green"
color = "blue"
color = "white"
color = "black"
```

Easy Draw uses the color names your web browser knows. Here is the full list of color names:

{% embed url="<https://developer.mozilla.org/en-US/docs/Web/CSS/named-color>" %}

{% hint style="info" %}
Color names with spaces, like `"sky blue"`, work the same as `"skyblue"`. Gray shades from `"gray0"` (black) to `"gray100"` (white) also work.
{% endhint %}

## 2. RGB Value

You can define a color as a tuple with 3 color values representing red, green, and blue. This is known as “RGB”. RGB stands for Red, Green, and Blue. We specify how much red, green, and blue to use by a number range of 0-255. No light is zero. Turn the light on all the way on and it is 255. We need three numbers to specify three colors, so (0, 0, 0) means no red, no green, no blue -- Black.

Here are some other examples:

| **Red** | **Green** | **Blue** | **Color** |
| ------- | --------- | -------- | --------- |
| 0       | 0         | 0        | Black     |
| 255     | 255       | 255      | White     |
| 127     | 127       | 127      | Gray      |
| 255     | 0         | 0        | Red       |
| 0       | 255       | 0        | Green     |
| 0       | 0         | 255      | Blue      |
| 255     | 255       | 0        | Yellow    |

Examples:

```python
color = (255, 0, 0)
color = (0, 255, 0)
color = (0, 0, 255)
color = (255, 255, 255)
color = (0, 0, 0)
```

To turn an RGB value into a hex value, use `rgb_convert()`:

```python
hex_color = easy_draw.rgb_convert((255, 0, 0))    # "#ff0000"
```

## 3. Hex Value

Hex color values represent color in the same way as RGB, but instead of decimal (base 10) number values they use hexadecimal (base 16) values.

A hexadecimal color is specified with: `#RRGGBB`.

RR (red), GG (green) and BB (blue) are hexadecimal integers between 00 and FF specifying the intensity of the color.

For example, `#0000FF` is displayed as blue, because the blue component is set to its highest value (FF) and the others are set to 00.

Examples:

```python
color = "#FF0000"
color = "#00FF00"
color = "#0000FF"
color = "#FFFFFF"
color = "#000000"
```

## Easy Draw's Color Picker

To make it easy to discover colors, the Easy Draw page has a **Color Picker** button.

The color picker comes from your web browser, so it will look different in different browsers.

When you select a color, the Easy Draw page displays the Hex and RGB value for you to record and use in your program.
