Sign InCoursewareNuggetsTutorials AboutClassesCodePad

Holiday Card

We have used turtle graphics to paint pictures using common color names such as "red" or "blue". In many occasions we would like to choose our own mixed colors for specific themes. Turtle allows us to use RGB or hex color codes. For example, color "red" in RGB color code is (255,0,0) and in hex color code is #FF0000. There are many online resource about RGB color, such as this one.

Although the color codes are flexible, they are hard to remember. Your task is to create a dictionary to map color names to hex codes. Choose your favorate holiday theme and include at least four colors for that holiday. Feel free to use fun names that match the color and theme. For example, a Halloween themed colors might include orange, black, purple and green. Your dictionary may look like this.

halloween_colors = {"pumpkin": "#ff9a00", "bat": "#000000", "boogreen": "#09ff00", "boopurple": "#c900ff"}

Draw a holiday card using the colors in the dictionary you just created.

# Draw a holiday-themed card. Make sure to use a dictionary to map color name to hex color code. import turtle
© CS Wonders·About·Classes·Cheatsheet