Skip to content

Commit

Permalink
Fix BrightnessSlider transparent background
Browse files Browse the repository at this point in the history
After a thorough refactoring of the BrightnessSlider somewhere after
release 1.0.4, the slider background would falsely show a gradient going
from full transparency to zero transparency.

This commit removes the alpha logic and replaces it with the previously
used shader going from pure black to the (pure) selected colour.

Fixes #42
  • Loading branch information
moertel committed Dec 7, 2023
1 parent 190216f commit 0559d43
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ public fun BrightnessSlider(
canvas.drawImage(it, Offset.Zero, Paint())

// draw a linear gradient color shader.
val startColor = controller.pureSelectedColor.value.copy(alpha = 0f)
val endColor = controller.pureSelectedColor.value.copy(alpha = 1f)
val startColor = Color.Black
val endColor = controller.pureSelectedColor.value
val shader = LinearGradientShader(
colors = listOf(startColor, endColor),
from = Offset.Zero,
Expand Down

0 comments on commit 0559d43

Please sign in to comment.