Scenic v0.10.2 Scenic.Primitive.Style.Paint View Source
Paint is used to "fill" the area of primitives.
When you apply the :fill
style to a primitive, you must supply valid
paint data.
There are five types of paint.
:color
- Fill with a solid color. This is the most common and has shortcuts.:image
- Fill with an image from the cache.:box_gradient
- Fill with a box gradient.:linear_gradient
- Fill with a linear gradient.:radial_gradient
- Fill with a radial gradient.
See the documentation for each type for details.
Color Shortcut
Filling with a color is so common, you can just declare any valid color in a fill, and it will figure out the right paint to use.
Examples:
graph
|> rect({100,200}, fill: :blue)
|> rect({60,120}, fill: {:blue, 128})
|> rect({30,60}, fill: {10,20,30,40})