jordond / kmpalette Goto Github PK
View Code? Open in Web Editor NEW๐จ A Compose multiplatform port for Androidx Palette. Generate a color palette from an image.
Home Page: https://demo.kmpalette.com/
License: MIT License
๐จ A Compose multiplatform port for Androidx Palette. Generate a color palette from an image.
Home Page: https://demo.kmpalette.com/
License: MIT License
This is hard to reproduce and I only faced this error myself once as well as only once by another user.
So I have no idea by what this is caused.
Could we change https://github.com/jordond/kmpalette/blob/main/androidx-palette/src/commonMain/kotlin/com/kmpalette/palette/internal/utils/ColorUtils.kt#L78 to use min
and max
to force the alpha to be between 0 and 255 instead of throwing an exception?
Both require a lower version for the instrumented tests to pass ๐ค
I'm using androidx.palette
in an app and I'm migrating to Kotlin multiplatform. I found this great library, it has everything I need except one small thing.
After generating dominant colors from an ImageBitmap
, the API gives the user a way to filter & validate the dominant color by passing Swatch.rgb
to isColorValid: (Color) -> Boolean
lambda:
but in my use case, I want to validate dominant colors based on Swatch.bodyTextColor
:
Color(swatch.bodyTextColor).contrastAgainst(surfaceColor) >= MinContrastRatio // 3f
I think it is more appropriate to expose the Swatch
object instead, and let the caller decide how to validate the color based on Swatch
properties.
Seems like only web isn't supported as of yet. Any plans on supporting it?
Is there any plan for an image-loading extension that take an absolute path as input? That would be great. Thanks
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
org.jetbrains.kotlinx.kover
, org.jetbrains.kotlin.android
, org.jetbrains.kotlin.native.cocoapods
, org.jetbrains.kotlin.multiplatform
)org.jetbrains.kotlin.android
, org.jetbrains.kotlin.native.cocoapods
, org.jetbrains.kotlin.multiplatform
)demo/iosApp/Podfile
.github/workflows/ci.yml
actions/checkout v4
actions/setup-java v4
gradle/wrapper-validation-action v3
gradle/gradle-build-action v3
gradle/gradle-build-action v3
actions/checkout v4
actions/setup-java v4
actions/cache v4
gradle/wrapper-validation-action v3
gradle/gradle-build-action v3
actions/checkout v4
actions/setup-java v4
gradle/wrapper-validation-action v3
reactivecircus/android-emulator-runner v2
actions/checkout v4
actions/setup-java v4
gradle/wrapper-validation-action v3
browser-actions/setup-chrome v1
.github/workflows/publish.yml
actions/checkout v4
actions/setup-java v4
actions/cache v4
gradle/wrapper-validation-action v3
EndBug/add-and-commit v9
actions/checkout v4
actions/setup-java v4
gradle/wrapper-validation-action v3
gradle/gradle-build-action v3
JamesIves/github-pages-deploy-action v4
actions/checkout v4
actions/setup-java v4
gradle/wrapper-validation-action v3
gradle/gradle-build-action v3
cloudflare/pages-action v1
gradle.properties
settings.gradle.kts
com.gradle.enterprise 3.17.4
build.gradle.kts
androidx-palette/build.gradle.kts
demo/composeApp/build.gradle.kts
extensions-base64/build.gradle.kts
extensions-bytearray/build.gradle.kts
extensions-file/build.gradle.kts
extensions-libres/build.gradle.kts
extensions-network/build.gradle.kts
gradle/libs.versions.toml
androidx.annotation:annotation 1.8.0
androidx.collection:collection 1.4.0
androidx.lifecycle:lifecycle-runtime-ktx 2.8.0
androidx.lifecycle:lifecycle-runtime-compose 2.8.0
androidx.appcompat:appcompat 1.6.1
androidx.activity:activity-compose 1.9.0
androidx.startup:startup-runtime 1.1.1
androidx.test:runner 1.5.2
androidx.test:rules 1.5.0
androidx.test.ext:junit-ktx 1.1.5
androidx.test.espresso:espresso-core 3.5.1
androidx.compose.ui:ui-tooling 1.6.7
co.touchlab:kermit 2.0.3
com.soywiz.korlibs.korim:korim 4.0.10
junit:junit 4.13.2
com.squareup.okio:okio 3.9.0
org.robolectric:robolectric 4.12.2
io.ktor:ktor-client-core 2.3.11
io.ktor:ktor-client-android 2.3.11
io.ktor:ktor-client-okhttp 2.3.11
io.ktor:ktor-client-darwin 2.3.11
io.ktor:ktor-client-js 2.3.11
io.github.skeptick.libres:libres-compose 1.2.2
com.materialkolor:material-kolor 1.5.1
cafe.adriel.voyager:voyager-navigator 1.0.0
com.mohamedrejeb.calf:calf-file-picker 0.4.0
media.kamel:kamel-image 0.9.4
org.jetbrains.kotlin.multiplatform 1.9.23
org.jetbrains.compose 1.6.2
org.jetbrains.kotlin.native.cocoapods 1.9.23
com.android.application 8.4.1
com.android.library 8.4.1
org.jetbrains.kotlin.android 1.9.23
io.github.skeptick.libres 1.2.2
com.github.ben-manes.versions 0.51.0
org.jetbrains.kotlinx.binary-compatibility-validator 0.14.0
org.jetbrains.dokka 1.9.20
com.vanniktech.maven.publish 0.28.0
org.jetbrains.kotlinx.kover 0.7.6
dev.drewhamilton.poko 0.15.3
kmpalette-bitmap-loader/build.gradle.kts
kmpalette-core/build.gradle.kts
test-utils/build.gradle.kts
gradle/wrapper/gradle-wrapper.properties
gradle 8.7
Despite #21, the error still triggers with 2.0.0.
Caused by: java.lang.RuntimeException: Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be smaller than version 24 declared in library [com.kmpalette:kmpalette-core-android-debug:2.0.0]
Happens on Android build, other targets working fine
Duplicate class androidx.palette.graphics.Palette found in modules androidx-palette-debug-runtime (com.kmpalette:androidx-palette-android-debug:2.1.0) and palette-1.0.0-runtime (androidx.palette:palette:1.0.0)
Duplicate class androidx.palette.graphics.Palette$Builder found in modules androidx-palette-debug-runtime (com.kmpalette:androidx-palette-android-debug:2.1.0) and palette-1.0.0-runtime (androidx.palette:palette:1.0.0)
Duplicate class androidx.palette.graphics.Palette$Filter found in modules androidx-palette-debug-runtime (com.kmpalette:androidx-palette-android-debug:2.1.0) and palette-1.0.0-runtime (androidx.palette:palette:1.0.0)
Duplicate class androidx.palette.graphics.Palette$Swatch found in modules androidx-palette-debug-runtime (com.kmpalette:androidx-palette-android-debug:2.1.0) and palette-1.0.0-runtime (androidx.palette:palette:1.0.0)
Duplicate class androidx.palette.graphics.Target found in modules androidx-palette-debug-runtime (com.kmpalette:androidx-palette-android-debug:2.1.0) and palette-1.0.0-runtime (androidx.palette:palette:1.0.0)
Duplicate class androidx.palette.graphics.Target$Builder found in modules androidx-palette-debug-runtime (com.kmpalette:androidx-palette-android-debug:2.1.0) and palette-1.0.0-runtime (androidx.palette:palette:1.0.0)
Are you planning on adding Wasm target?
This is a great library, I love it!
But I encountered some problems in using.
Is it possible to separate out an androidx-palette-core module that only supports Kotlin Multiplatform from the androidx-palette module, since I don't need compose support.
Duplicate class androidx.annotation.ColorInt found in modules androidx-palette-debug-runtime (com.kmpalette:androidx-palette-android-debug:2.0.0) and annotation-jvm-1.7.0-rc01 (androidx.annotation:annotation-jvm:1.7.0-rc01)
Duplicate class androidx.annotation.FloatRange found in modules androidx-palette-debug-runtime (com.kmpalette:androidx-palette-android-debug:2.0.0) and annotation-jvm-1.7.0-rc01 (androidx.annotation:annotation-jvm:1.7.0-rc01)
Duplicate class androidx.annotation.IntRange found in modules androidx-palette-debug-runtime (com.kmpalette:androidx-palette-android-debug:2.0.0) and annotation-jvm-1.7.0-rc01 (androidx.annotation:annotation-jvm:1.7.0-rc01)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.