Using context instructions

This recipe brings colors to our apps. As we said, the context instructions are those that do not draw but give context to the canvas. The recipe will give color to some geometric shapes.

Getting ready

The last recipe is related to this recipe. So, it should be useful to compare them because you will better understand the difference between the context and drawing instructions with practice. Also, we will use different color models, such as RGB.

How to do it…

Here, we are going to use a simple Python file in our app and concentrate on the KV file, which will have context and drawing instructions to generate the graphics in the app. To complete the recipe, follow these steps:

  1. In the KV file, define the rule for the root widget. ...

Get Kivy Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.