At My Fingertips
Rapid Playground
Implement the hue_to_tile
and the hue_bar
functions to produce the following graphic.
This is a hue bar consisting of 360 tiles, each tile is a rectangle, colored with a fully saturated (saturation 1.0) fully light (value 1.0) color in the corresponding hue (0 to 359). Use the pytamaro hsv_color function to create the color from the hue, saturation, and value.
This function should return a rectangle of the given width
and height
. The color of the tile is composed of the given hue
, a saturation of 1, and a value of 1, using the pytamaro hsv_color function.
Assert that the value of the hue
parameter is acceptable (between 0 and 360).
This function takes the wanted tile_width
and tile_height
for each of the 365 tiles, and it produces 360 hue tiles corresponding to each hue value from 0 to 359. Ultimately it returns a Graphic with each tile placed beside the other.
To achieve this you can use a for-loop.
In each step of the loop you want to create a tile of a different hue, and place it beside the previous tiles.
Use the result
variable to store the graphic containing all the (previous) tiles together.
This activity has been created by LuCE Research Lab and is licensed under CC BY-SA 4.0.
Hue Bar
PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI
Privacy Policy • Platform Version 0d7866a (Fri, 20 Dec 2024 07:46:38 GMT)