-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathrgb_colours.py
More file actions
33 lines (29 loc) · 747 Bytes
/
rgb_colours.py
File metadata and controls
33 lines (29 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# This program knows about the RGB code corresponding to common colours.
#
# Usage:
#
# $ python rgb_colours.py [colour]
#
# For instance:
#
# $ python rgb_colours.py red
# The RGB code for red is F00
#
# or:
#
# $ python rgb_colours.py "burnt sienna"
# I don't know the RGB code for burnt sienna
colours = [
['red', 'F00'],
['yellow', 'FF0'],
['green', '0F0'],
['cyan', '0FF'],
['blue', '00F'],
['magenta', 'F0F'],
]
# TODO:
# * Implement the program as described in the comments at the top of the file.
# TODO (extra):
# * Change the program so that users can also enter an RGB colour code, and be
# told the name of the corresponding colour.
# * Change the program so that it ignores the case of the user's input.