Scenic.Primitives.rounded_rectangle

You're seeing just the function rounded_rectangle, go back to Scenic.Primitives module for more information.
Link to this function

rounded_rectangle(graph_or_primitive, rounded_rectangle, opts \\ [])

View Source

Specs

rounded_rectangle(
  source :: Scenic.Graph.t() | Scenic.Primitive.t(),
  rounded_rectangle ::
    {width :: number(), height :: number(), radius :: number()},
  options :: list()
) :: Scenic.Graph.t() | Scenic.Primitive.t()

Add a rounded rectangle to a graph.

Rounded rectangles are defined by a width, height, and radius.

Data:

{ width, height, radius }

The following example will draw a rounded rectangle.

graph
|> rounded_rectangle( {100, 200, 8} )

Styles

Rounded rectangles honor the following styles

  • :hidden - If true, the outline is rendered. If false, it is skipped. Default: false.
  • :fill - Fills in the interior with the specified paint. If not set, the default is to not draw anything in the interior. This is similar to specifying fill: :clear, except optimized out to do nothing.
  • :stroke - The width and paint to draw the outline with. If the stroke is not specified then the default stroke is {1, :white}

Example:

graph
|> rounded_rectangle( {100, 200, 8},
  fill: :red, stroke: {3, :blue} )