At My Fingertips

Documentation

Base Colors

Let's implement the rgb_dots function that creates three rgb circles, and the cmy_squares function that creates three cmy squares, to recreate the following graphics.

base colors

Circles and Squares

Circles and squares are just special kinds of ellipses and rectangles, for which PyTamaro provides functions.

In order to avoid calling the ellipse function, that takes a width and a height each time, let's implement a circle function, that only needs a diameter.

Loading...

For the same reason, let's implement a square function that only needs a parameter side, to avoid calling the rectangle function that needs a width and a height each time.

Loading...

RGB dots

Let's now implement the rgb_dots function that returns three circles of the given circle_diameter, each beside the other: one of color red, one green and one blue. Use the circle function you defined above!

Loading...

CMY Squares

Lastly, let's implement the cmy_squares function that returns three squares of the given square_side, each beside the other: one of color cyan, one magenta and one yellow. Use the square function you defined above!

Loading...

This activity has been created by LuCE Research Lab and is licensed under CC BY-SA 4.0.

Base Colors

Logo of PyTamaro

PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI

Privacy PolicyPlatform Version 79aacf0 (Fri, 08 Nov 2024 13:24:29 GMT)