avyos.dev/pkg/graphics/renderer

package renderer

Overview

No package-level documentation is provided.

Export GroupCount
Constants0
Variables0
Functions14
Types0

Functions

ClampRoundedRadius

func ClampRoundedRadius(r image.Rectangle, radius int) int

DrawAALine

func DrawAALine(buf *core.Buffer, x0, y0, x1, y1, width float64, c color.NRGBA)

DrawAALine draws an antialiased line with width and alpha blending.

DrawFocusRing

func DrawFocusRing(buf *core.Buffer, bounds image.Rectangle, radius int, ringColor color.NRGBA, ringWidth, ringOffset int)

DrawFocusRing draws an outward focus ring around bounds.

DrawListRowFill

func DrawListRowFill(buf *core.Buffer, row image.Rectangle, radius int, solid, top, bottom color.NRGBA)

DrawListRowFill draws either a solid or gradient list row fill.

DrawRoundedShadow

func DrawRoundedShadow(
	buf *core.Buffer,
	shadowRect image.Rectangle,
	radius int,
	shadowColor color.NRGBA,
	shadowBase color.NRGBA,
	spread int,
	gap int,
)

DrawRoundedShadow draws a soft shadow outside a rounded rect. shadowRect is the target rounded rectangle already offset into its final position.

DrawVerticalGradient

func DrawVerticalGradient(buf *core.Buffer, r image.Rectangle, radius int, top, bottom color.NRGBA)

DrawVerticalGradient draws a vertical gradient in r, clipping to rounded corners when radius>0.

MixColors

func MixColors(a, b color.NRGBA, t float64) color.NRGBA

MixColors linearly blends color a->b by t in [0..1].

PointInRoundedRect

func PointInRoundedRect(x, y int, r image.Rectangle, radius int) bool

PointInRoundedRectAt

func PointInRoundedRectAt(px, py float64, r image.Rectangle, radius int) bool

PointInRoundedRectAtClamped

func PointInRoundedRectAtClamped(px, py float64, r image.Rectangle, radius int) bool

RoundedRectCoverage

func RoundedRectCoverage(x, y int, r image.Rectangle, radius int) float64

RoundedRectOutsideDistance

func RoundedRectOutsideDistance(px, py float64, r image.Rectangle, radius int) float64

RoundedRectSignedDistance

func RoundedRectSignedDistance(px, py float64, r image.Rectangle, radius int) float64

TrimTextToWidth

func TrimTextToWidth(font *gfxfont.Font, text string, maxWidth int, align string) string

TrimTextToWidth shortens text to fit maxWidth, keeping right-alignment behavior.