Box
|
The page is in the process of being translated. |
A simple rectangle with optionally rounded corners. This can be useful to visually group parts of a layout, or as a placeholder.
Attributes
color
Defaults to RGBf(0.9, 0.9, 0.9)
using CairoMakie
fig = Figure()
Box(fig[1, 1], color = :red)
Box(fig[1, 2], color = (:red, 0.5))
Box(fig[2, 1], color = RGBf(0.2, 0.5, 0.7))
Box(fig[2, 2], color = RGBAf(0.2, 0.5, 0.7, 0.5))
fig
cornerradius
Defaults to 0.0
The radius of the rounded corner. One number is for all four corners, four numbers for going clockwise from top-right.
using CairoMakie
fig = Figure()
Box(fig[1, 1], cornerradius = 0)
Box(fig[1, 2], cornerradius = 20)
Box(fig[1, 3], cornerradius = (0, 10, 20, 30))
fig
linestyle
Defaults to nothing
using CairoMakie
fig = Figure()
Box(fig[1, 1], linestyle = :solid)
Box(fig[1, 2], linestyle = :dot)
Box(fig[1, 3], linestyle = :dash)
fig
strokecolor
Defaults to RGBf(0, 0, 0)
using CairoMakie
fig = Figure()
Box(fig[1, 1], strokecolor = :red)
Box(fig[1, 2], strokecolor = (:red, 0.5))
Box(fig[2, 1], strokecolor = RGBf(0.2, 0.5, 0.7))
Box(fig[2, 2], strokecolor = RGBAf(0.2, 0.5, 0.7, 0.5))
fig