| Age | Commit message (Collapse) | Author | Files | Lines |
|
A boolean goes wrong as soon as two sliders of the same kind share a
controller: the first one to leave the composition clears it while the
other is still on screen, and the surviving slider stops reaching the
color. The controller counts them now, and the last one out is what
hands the component back to the palette color.
Adds regression tests for both, four of which fail when a slider that
leaves stays attached, and two when one leaving speaks for the other.
|
|
Resolutions:
- Took main for the Spotless bump, the ktlint reformats, the version
catalog and the wheel bitmap property, all of which landed separately.
- Kept the benchmark build type and the baselineProfile dependency on
:demo:androidApp, which the baseline-profile workflow needs.
- ObserveColorChanges now uses rememberCoroutineScope as well, so the
picker and the sliders collect the same way, and ColorPicker just
delegates to it.
- Tests build the controller without a scope, and the ones that read a
callback wait for idle first, since a color change now arrives on the
composition's own scope rather than Dispatchers.Main.
|
|
onColorChanged fires for every step of a drag, so there was no way to
tell a live preview apart from a finished choice. HsvColorPicker and
ImageColorPicker now take onColorPickingFinished, which fires once when
a tap lands or a drag ends, with the color the pick settled on.
|
|
- The thumb was centered on the track ends, so half of it was clipped
away. It now reserves its radius at each end, and the tap and drag
mapping uses the same travel.
- The track paint took its color, and so its alpha, from the controller.
A controller with nothing selected is transparent, which left a slider
used without a picker drawing nothing at all.
- The brightness ramp assumed full saturation and painted red instead of
a grey ramp when nothing was selected.
- AlphaSlider, BrightnessSlider and SaturationSlider take onColorChanged
so they report without a picker beside them.
- Every slider takes an orientation and can run bottom to top.
- The slider and tile backgrounds are no longer rebuilt on every
recomposition, and the initial value is no longer written during the
draw phase.
|
|
A palette scaled to fit leaves bands beside it, and the picker used to
clamp a tap there onto the nearest edge pixel and report it as a color.
Fully transparent pixels came back as a selection too, which is the
transparent pixel TODO the original Android version handled by skipping
them. Both now leave the selection alone.
|
|
- The canvas size setter divided by a zero size on the first layout pass
and produced Offset(NaN, NaN), which is Offset.Unspecified, so drawing
the wheel threw whenever setup could not overwrite it.
- setup() now leaves the current selection alone when a picker registers
itself again, which happens on every recomposition if the palette is
built inline.
- HsvColorPicker replays initialColor so its value and alpha survive.
- selectByColor before the first layout is held and applied once the
picker is ready instead of being dropped.
- wheelImageBitmap is kept in step with the controller and is snapshot
state, so a new bitmap repaints.
|
|
Wires up commonTest and desktopTest with kotlin-test and the Compose
multiplatform ui-test artifact, and covers the color math, the geometry
helpers, the controller, both pickers, the sliders and the alpha tile.
The web targets skip tests because ColorPickerController builds a Paint
eagerly and Kotlin/JS cannot load Skiko in a Node or headless run.
CI gains a job for them, and drops the branch filter on pull_request so
that a pull request stacked on another one gets checked too.
|