Colors
Last updated
Last updated
There are 3 ways you can use colors in Easy Draw:
The easiest way to represent an color is by using the color's name in a string.
Examples:
Here is a list of many of the colors Easy Draw supports.
Easy Draw uses all Tkinter color values. Any Tkinter color value will work in Easy Draw.
You can define a color as a tuple with 3 color values representing red, green, and blue. This is know 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:
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:
To make it easy to discover colors, Easy Draw comes with a built in color picker.
It will look different on different operating systems.
But when you select a color, it will display the Hex and RGB value for you to record and use in your program.