WaveformColors

data class WaveformColors(val waveColor: Brush, val progressColor: Brush? = null, val inactiveColor: Brush? = null, val backgroundColor: Color = Color.Transparent)

Color configuration for AudioWaveform.

Supports solid colors, gradients, and different colors for played/unplayed portions.

Example Usage

// Simple solid color
AudioWaveform(
amplitudes = amplitudes,
colors = WaveformColors.solidColor(Color.Green)
)

// Gradient
AudioWaveform(
amplitudes = amplitudes,
colors = WaveformColors.gradient(listOf(Color.Cyan, Color.Blue))
)

// With progress colors (for playback)
AudioWaveform(
amplitudes = amplitudes,
colors = WaveformColors(
waveColor = SolidColor(Color.Green),
progressColor = SolidColor(Color.White),
inactiveColor = SolidColor(Color.Gray),
),
progress = 0.5f
)

Parameters

waveColor

Primary color/brush for the waveform

progressColor

Color for the "played" portion when using progress (defaults to waveColor)

inactiveColor

Color for the "unplayed" portion when using progress (defaults to waveColor with reduced alpha)

backgroundColor

Optional background color for the waveform area

Constructors

Link copied to clipboard
constructor(waveColor: Brush, progressColor: Brush? = null, inactiveColor: Brush? = null, backgroundColor: Color = Color.Transparent)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Returns the effective inactive color, falling back to a dimmed version of waveColor.

Link copied to clipboard

Returns the effective progress color, falling back to waveColor if not specified.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard