LavaUI docs GitHub

struct SpeakerMark

Swift

struct SpeakerMark

A speaker with sound waves that light with the volume, or a cross when muted — for volume buttons, drawn rather than taken from "🔊", for the same reasons as TransportMark.

The body and horn are one polygon and the waves are thin ring segments, so every edge, curved ones included, gets the renderer's antialiased fringe. paint is the drawing on its own, for a Canvas that needs handlers of its own (the panel's takes the wheel).

Sources/LavaUI/Mark.swift:140

Constructors

init(level: Float, muted: Bool = false, size: Float = 16, color: Color = .primary, mutedColor: Color? = nil)

Not documented.

Sources/LavaUI/Mark.swift:149

Properties

var body: some View { get }

Not documented.

Sources/LavaUI/Mark.swift:160

var color: Color

Not documented.

Sources/LavaUI/Mark.swift:145

var level: Float

0...1. Each of the three waves lights at a quarter more.

Sources/LavaUI/Mark.swift:142

var muted: Bool

Not documented.

Sources/LavaUI/Mark.swift:143

var mutedColor: Color?

The cross when muted; nil uses color.

Sources/LavaUI/Mark.swift:147

var size: Float

Not documented.

Sources/LavaUI/Mark.swift:144

Methods

static func paint(list: DrawList, frame: CanvasFrame, level: Float, muted: Bool, color: Color, mutedColor: Color)

Draws the mark centred in the square that fits frame. Unlit waves stay faintly visible, so the speaker reads the same at any volume.

Sources/LavaUI/Mark.swift:172