Last updated
Last updated
The central component of valora is the . The canvas supports many low level drawing operations such as drawing paths and stroking or filling them. For example, we can draw a triangle like this:
You can implement Paint
for your own patterns and easily compose them, as we will see in later chapters.
Thankfully in valora we don't have to work at such a low level unless we want to. Valora defines the trait, which is implemented by any type that knows how to represent itself on a canvas. We can instead draw an equilateral triangle like this:
Valora's painting surface.