summaryrefslogtreecommitdiff
path: root/colorpicker-compose/src
AgeCommit message (Collapse)AuthorFilesLines
2026-09-16Count attached sliders instead of flagging themskydoves5-53/+274
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.
2026-09-16Merge branch 'main' into slider-attachmentskydoves34-143/+2686
2026-09-16Merge main into the desktop demoskydoves32-129/+2685
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.
2026-09-16Bump Gradle, AGP, Kotlin, Compose and Spotlessskydoves4-17/+8
AGP 9.3.2 to 9.4.0, Kotlin 2.4.10 to 2.4.20, Compose Multiplatform 1.11.1 to 1.12.0, binary compatibility validator 0.18.1 to 0.18.2, macrobenchmark off its alpha, Spotless 6.21.0 to 8.10.2 and the Gradle wrapper 9.6.1 to 9.7.1. Compose 1.12.0 asks for compileSdk 37. Spotless 8 brings a newer ktlint, which reformats a few files, wants screaming snake case for a const in the benchmark, and needs to be told that a Composable is named like a type.
2026-09-16Add onColorPickingFinished to the pickersskydoves5-4/+187
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.
2026-09-16Fix slider rendering and let sliders stand aloneskydoves11-60/+593
- 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.
2026-09-16Ignore taps that land outside the paletteskydoves4-13/+189
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.
2026-09-16Fix pickers losing the color they were givenskydoves7-52/+361
- 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.
2026-09-16Add a test suite for the libraryskydoves13-0/+1371
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.
2026-07-21support for sliders dynamic attachment and detachmentAzerlag4-6/+60
2026-07-19Fix typos and misplaced KDoc across slider componentsprshntpnwr4-6/+6
- Fix 'of th wheel' typo in AlphaSlider, BrightnessSlider, Slider - Fix stray word in Slider's class-level KDoc - Fix 'Crop ths source' typo in PaletteContentScale - Fix 'sider' -> 'slider' typo (x3) in README - Move misplaced initialColor KDoc sentence in AlphaSlider
2026-06-08Add desktop demo and rework demo modulesSean Proctor3-20/+12
- Add :demo:desktopApp (Compose JVM desktop application) consuming the shared MainScreen. - Move :wasmApp under :demo:wasmApp and consume the shared MainScreen. - Migrate demo image picking from peekaboo-image-picker to FileKit. - Set the demo Res class package to com.github.skydoves.colorpickercomposedemo.shared via packageOfResClass. - Drop the GlobalScope/CoroutineScope constructor from ColorPickerController; ColorPicker now collects on a rememberCoroutineScope. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08Update Spotless to 8.6.0Sean Proctor2-7/+2
Spotless 6.21.0 bundled an old ktlint whose adapter could not parse the editorConfig overrides against the newer ktlint-rule-engine-core on the classpath, so spotlessCheck/spotlessApply failed before formatting any file. - Bump spotless 6.21.0 -> 8.6.0 (ships ktlint 1.x). - Exempt @Composable functions from the function-naming rule. - Rename benchmark `packageName` const to `PACKAGE_NAME` (ktlint 1.x property-naming rule; not auto-fixable). - Reformat library/docs/benchmark sources for ktlint 1.x defaults (single-line signatures, expression bodies, blank lines between when branches). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-04-29add controller keys to pointerInput to prevent stale lambda captureAzerlag2-4/+8
2026-04-29adapt GradientColors to selected colorAzerlag1-1/+0
2026-04-29adapt GradientColors to selected colorAzerlag2-2/+10
2026-04-26remove android import, apply spotless formattingAzerlag6-147/+198
2026-04-26public enum classAzerlag1-2/+2
2026-04-26Add files via uploadAzerlag10-24/+300
2026-04-24new onStart/onFinish listenersAzerlag1-9/+20
2026-04-24new onStart/onFinish listenersAzerlag1-0/+4
2026-04-24new onStart/onFinish listenersAzerlag1-0/+4
2024-06-29Apply debounceDurationskydoves3-11/+15
2024-06-29Implement setDebounceDuration functionskydoves6-25/+34
2024-06-29Implement setPaletteImageBitmap and sync imageBitmap changesskydoves3-23/+80
2024-06-29Filter compose color picker libraryskydoves1-13440/+1
2024-06-29Update baseline profilesskydoves1-0/+13668
2024-06-29Remove android annotations on the comment APIsskydoves3-7/+4
2024-06-29Clean up internal logicsskydoves4-33/+30
2024-06-28Add back the selectCenter() method.Jeffrey Bush1-0/+9
2024-06-28Code quality updatesJeffrey Bush13-73/+108
2024-06-28Initial transition to multiplatformJeffrey Bush29-1696/+1320
2024-06-22Implement previewImagePainter for the ImageColorPickerskydoves1-0/+15
2024-06-22Implement selectByHsvskydoves1-2/+26
2024-05-09Merge pull request #54 from darktiny/fix_alphaJaewoong Eum1-1/+3
Fix selectByColor not updating alpha
2024-05-09Merge pull request #57 from sderr/fix_color_resetJaewoong Eum1-1/+5
quickfix for occasional color reset to white on recomposition
2024-05-09quickfix for occasional color reset to white on recompositionSimon Derr1-1/+5
On rare occasions, (was seen using a color picker in an animated widget) the color picker will reset the selected color to white after a recomposition. This seems to be due to onSizeChanged() being called, even though the color picker did not really change size. For the HSV color picker it is possible to re-select automatically the previously picked color, since the coordinates can be calculated. For the ImageColorPicker, a more elaborate fix would be needed.
2024-05-07BitmapCalculator: fix use of a recycled bitmapSimon Derr1-6/+11
This commit fixes this warning message which happens with the HSV color picker: "Called getWidth() on a recycle()'d bitmap! This is undefined behavior!" It is likely due to the fact that createScaledBitmap() will usually return a new bitmap, but will return the source bitmap if the dimensions are the same. This commit makes sure that scaleBitmap() will always return a new bitmap.
2024-03-25Fix selectByColor not updating alphadarktiny1-1/+3
2023-12-08Merge pull request #48 from skydoves/refactor/setBrightnessJaewoong Eum3-11/+13
Expose setBrightness to public
2023-12-08Expose setBrightness to publicskydoves3-11/+13
2023-12-07Fix BrightnessSlider transparent backgroundStefanie Grunwald1-2/+2
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
2023-11-23Add comments to selectByColor methodruigoncalo1-1/+6
2023-11-23Add selectByColor to ColorPickerControllerruigoncalo1-0/+28
2023-10-01Generate baseline profilesskydoves1-0/+208
2023-10-01Implement benchmark moduleskydoves1-0/+4
2023-10-01Migrate to kts gradle scriptsskydoves16-31/+31
2023-10-01Fix bordoer for BrightnessSlider not showingskydoves14-1068/+1070
2023-09-09Fix BrightnessSlider Kdocyangsooplus1-1/+1
2023-09-09Add initialColor to the AlphaSlideryangsooplus1-0/+12