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
)Content copied to clipboard
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