public readonly record struct BoxStyleWhat a box needs beyond a colour and a size.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
⚠ A side buffer, not more fields on DrawCommand. Eight radius floats, a colour and an axis would half again the size of the struct the frame diff compares every frame — and every text run, every path and every plain rectangle would pay for them. The draw list already keeps variable and rare things beside the commands, for glyphs and for path segments, and this is the same argument with a different shape.
⚠ A zero axis is the sentinel for "no gradient" rather than a flag beside it. A gradient along no direction is not a gradient anybody can mean, so the value is free; a separate bool would be a second thing to keep in step and a state — flag set, axis zero — that has no meaning.
Fields and properties (4)
public CornerRadii CornersIts corner radii.
public Color4 GradientEndThe colour at the far end of its gradient.
public Vector2 GradientAxisWhich way the gradient runs, as a direction in the box's own space. A zero axis means the box is filled flat and is not read.
public bool HasGradientWhether this box is filled with more than one colour.
Methods (3)
public BoxStyle(CornerRadii Corners, Color4 GradientEnd, Vector2 GradientAxis)What a box needs beyond a colour and a size.
public static BoxStyle Rounded(CornerRadii corners)Corners and nothing else.
public static BoxStyle Vertical(Color4 end, CornerRadii corners = default(CornerRadii))A gradient down the box, which is what a panel or a button usually wants.
Used by (10)
- ColorFieldVixen.Ui.Controls.Advanced
- ColorStripVixen.Ui.Controls.Advanced
- CurveEditorVixen.Ui.Controls.Advanced
- DrawContextVixen.Ui
- DrawListVixen.Ui
- GradientBarVixen.Ui.Controls.Advanced
- GradientRailVixen.Ui.Controls.Advanced
- UiGeometryBuilderVixen.Ui
- UiGeometryTestsVixen.Ui.Tests
- UiImageTestsVixen.Graphics.Golden.Tests