{"full_name":"jordond/kmpalette","owner":"jordond","name":"kmpalette","shard":"1","url":"https://github.com/jordond/kmpalette","description":"🎨 A Compose multiplatform port for Androidx Palette. Generate a color palette from an image.","homepage":"https://palette.materialkolor.com/","topics":["android","compose","compose-multiplatform","dominant-color","ios","kotlin","kotlin-multiplatform","androidx","palette","palette-generation","androidx-palette","kotlin-js"],"tag_pages":["android","compose","compose-multiplatform","ios","kotlin","kotlin-multiplatform"],"language":"Kotlin","license":"MIT","avatar":"https://avatars.githubusercontent.com/u/528792?u=c53c0557bbab4340bd1fc4e8c1db44106d054b02&v=4","created_at":"2023-09-11T19:18:09Z","pushed_at":"2026-11-10T18:52:15Z","metrics":{"stars":299,"forks":12,"watchers":1,"issues":21,"prs":259,"releases":14,"issues_open":5,"issues_closed":16,"prs_open":10,"prs_closed":43,"prs_merged":206,"discussions":2},"growth":{"day":{"stars":0,"forks":0,"base_day":"2026-11-15"}},"history":{"dates":["2026-11-10","2026-11-11","2026-11-12","2026-11-13","2026-11-14","2026-11-15","2026-11-16"],"stars":[299,299,299,299,299,299,299],"forks":[12,12,12,12,12,12,12],"watchers":[null,1,1,1,1,1,1],"issues_open":[null,5,5,5,5,5,5],"prs_open":[null,10,10,10,10,10,10]},"boards":{},"same_owner":[],"issues":[{"number":222,"title":"Doesn't work on IOS","comments":3,"created_at":"2025-07-11T20:25:24Z"},{"number":197,"title":"java.lang.IllegalStateException: Size is unspecified using Painter class","comments":2,"created_at":"2024-11-24T10:47:39Z"},{"number":221,"title":"Executing an app with `jsBrowserProductionRun` that uses a library which calls `rememberDominantColorState()` fails","comments":1,"created_at":"2025-05-09T18:55:33Z"},{"number":121,"title":"Alpha must be between 0 and 255","comments":1,"created_at":"2024-03-12T23:37:16Z"},{"number":1,"title":"Dependency Dashboard","comments":0,"created_at":"2023-09-11T19:18:57Z"}],"discussions":[{"number":198,"title":"Is library still mantained?","comments":1,"category":"Q&A","created_at":"2025-01-08T18:00:43Z"},{"number":59,"title":"Generating swatches from a Painter","comments":2,"category":"General","created_at":"2023-11-28T13:40:20Z"}],"latest_release":{"name":"4.0.0","tag":"4.0.0","published_at":"2026-08-28T14:51:42Z","body":"## 4.0.0\r\n\r\n4.0 is a significant rewrite. The Maven group changed, three modules are gone, `androidx-palette` no\r\nlonger depends on Compose, and every dominant-colour composable now requires explicit default\r\ncolours. Start with the [Migration Guide](MIGRATION.md).\r\n\r\n### Breaking Changes\r\n\r\n**New Maven coordinates.** The group changed from `com.kmpalette` to `com.materialkolor.palette`,\r\nand two artifacts were renamed. Kotlin package names (imports) have **not** changed.\r\n\r\n| Module               | Old Coordinate                          | New Coordinate                                 |\r\n|----------------------|-----------------------------------------|------------------------------------------------|\r\n| Core                 | `com.kmpalette:kmpalette-core`          | `com.materialkolor.palette:core`               |\r\n| Base64 extension     | `com.kmpalette:extensions-base64`       | `com.materialkolor.palette:extensions-base64`  |\r\n| Network extension    | `com.kmpalette:extensions-network`      | `com.materialkolor.palette:extensions-network` |\r\n| File extension       | `com.kmpalette:extensions-file`         | `com.materialkolor.palette:extensions-file`    |\r\n| Palette (no Compose) | `com.kmpalette:androidx-palette`        | `com.materialkolor.palette:androidx-palette`   |\r\n| Loader interface     | `com.kmpalette:kmpalette-bitmap-loader` | `com.materialkolor.palette:loader`             |\r\n| Resources extension  | `com.kmpalette:extensions-resources`    | Removed, now part of `core`                    |\r\n| Libres extension     | `com.kmpalette:extensions-libres`       | Removed, no replacement                        |\r\n| ByteArray extension  | `com.kmpalette:extensions-bytearray`    | Removed, now part of `core`                    |\r\n\r\n**`androidx-palette` is Compose-free.** `Palette.Builder` takes raw pixel data instead of an `ImageBitmap`.\r\n\r\n```diff\r\n- Palette.from(imageBitmap).generate()\r\n+ Palette.from(pixels, width, height).generate()\r\n```\r\n\r\nDepend on `core` if you want the `ImageBitmap` overload back.\r\n\r\n**Three modules are gone.** `ByteArrayLoader` and the resources composables moved into `core`, so\r\ndrop the `extensions-bytearray` and `extensions-resources` dependencies. **There\r\nis no Libres loader in 4.0.**\r\n\r\n**`extensions-file` uses FileKit instead of Okio.** Loaders take a `PlatformFile`, and Okio is no\r\nlonger a transitive dependency.\r\n\r\n**Default colours are now required, and the Material 3 dependency is gone.** Dominant colour states used to fall back to `MaterialTheme.colorScheme.primary` / `onPrimary`. With no `MaterialTheme`  it silently returns the baseline Material 3 palette, so anyone using a custom design system got the wrong colours. It also forced `compose.material3` onto `core`. Every `remember*DominantColorState` now requires both colours, and no module depends on Material 3.\r\n\r\n```diff\r\n- val state = rememberDominantColorState()\r\n+ val state = rememberDominantColorState(\r\n+     defaultColor = MaterialTheme.colorScheme.primary,\r\n+     defaultOnColor = MaterialTheme.colorScheme.onPrimary,\r\n+ )\r\n```\r\n\r\nPass whatever your theme uses.\r\n\r\n**One `DEFAULT_CACHE_SIZE` constant.** `DominantColorState.DEFAULT_CACHE_SIZE` (5) and\r\n`PaletteState.DEFAULT_CACHE_SIZE` (6) are gone, along with both companion objects.\r\n\r\n```diff\r\n- cacheSize = PaletteState.DEFAULT_CACHE_SIZE\r\n+ import com.kmpalette.DEFAULT_CACHE_SIZE\r\n+ cacheSize = DEFAULT_CACHE_SIZE\r\n```\r\n\r\n**Painter composables live in one package.** `rememberPainterDominantColorState` and\r\n`rememberPainterPaletteState` were exported from both `com.kmpalette` and\r\n`com.kmpalette.extensions.painter` with different defaults and parameter order. The `com.kmpalette`\r\ncopies have been removed, so painter now matches how resource and drawable are packaged.\r\n\r\n```diff\r\n- import com.kmpalette.rememberPainterPaletteState\r\n+ import com.kmpalette.extensions.painter.rememberPainterPaletteState\r\n```\r\n\r\n**`PaletteResult.Error.cause` is an `Exception`,** was a `Throwable`.\r\n","is_prerelease":false},"readme":true,"readme_zh":false,"news":[],"stale":false,"snapshot_at":"2026-11-16T09:23:14Z","history_start":"2026-09-06"}