🌈 Palette - A color picker library made in Jetpack Compose

Last update: Apr 17, 2022

🌈 Palette


A color picker library made in Jetpack Compose.


Including in your project

Gradle

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
	maven { url 'https://jitpack.io' }
	}
    }

Add the dependency.

dependencies {
 implementation 'com.github.Shivamdhuria:palette:Tag'
	}

Terminology

How to use

Palette(
       defaultColor = Color.Magenta,
       buttonSize = 210.dp,
       swatches = Presets.material(),
       innerRadius = 400f,
       strokeWidth = 120f,
       spacerRotation = 5f,
       spacerOutward = 2f,
       verticalAlignment = Middle,
       horizontalAlignment = Start,
       onColorSelected = { onColorSelected(it) }
     )

How to change positioning of Color Picker?

The color picker can be positioned by using the combinations of vertical and horizontal alignments. For verticalAlignment, use Top,Middle,Bottom and for horizontalAlignment, use Start,Center,End. For example to position the color picker on top left, use -

Palette(
        buttonSize = 210.dp,
        swatches = Presets.material(),
        verticalAlignment = VerticalAlignment.Top,
        horizontalAlignment = HorizontalAlignment.Start,
         )

Which would make the color picker look like this.

How to set button properties?

Palette(
        defaultColor = Color.Blue,
        buttonSize = 210.dp,
        selectedArchAnimationDuration = 1000,
        ...
        )

The library uses a FAB button under the hood whose defaultColor , buttonSize and selectedArchAnimationDuration can be set. selectedArchAnimationDuration is the duration of the color change animation of the button when a color is picked.

How to change colors in the Palette?

Palette(
       swatches = Presets.material(),
        )

swatches parameter accepts a list of Swatches. Each Swatch contains a list of colors. Ideally swatches must only shades of the same color but sometime you need to go a little crazy.

How to know when a color is picked?

Palette(
      onColorSelected = { onColorSelected(it) },
      swatches = Presets.material(),
        )

onColorSelected parameter accepts a function which is triggered when a color is picked. It also return the value of the Color which is picked.

Code & Issues

If you are a developer and you wish to contribute to the app please raise an issue, discuss, fork and submit a pull request. Follow Github Flow for collaboration!

Find this repository useful? ❤️

Support it by joining starring this repository.
And follow me on Medium, Github and Twitter

Project Maintainers

This project is founded and actively maintained by Shivam Dhuria.

License

Copyright 2021 Shivam Dhuria

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

GitHub

https://github.com/Shivamdhuria/palette
You might also like...

android Sticky-TimeLineView that made with jetpack-compose

android Sticky-TimeLineView that made with jetpack-compose

ComposeTimeLineView android Sticky-TimeLineView that made with jetpack-compose. Download implementation "io.github.jisungbin:timelineview:${version}"

Mar 7, 2022

New style for app design E-commerce Shop App UI made in Jetpack Compose.😉😎

New style for app design E-commerce Shop App UI made in Jetpack Compose.😉😎

E-commerceShopAppUI-Android New style for app design E-commerce Shop App UI made in Jetpack Compose. 😉 😎 (Navigation Components, Dagger-Hilt, Materi

Apr 15, 2022

android multi-fab that made with jetpack-compose

android multi-fab that made with jetpack-compose

ComposeMultiFab android multi-fab that made with jetpack-compose Download implementation "io.github.jisungbin:multifab:${version}" Usage @Composable f

Apr 21, 2022

New style for app design and Movies App with Movies API JetMaxMovies made in Jetpack Compose.😉😎

New style for app design and Movies App with Movies API JetMaxMovies made in Jetpack Compose.😉😎

JetMaxMovie New style for app design and Movies App with Movies API JetMaxMovies made in Jetpack Compose. 😉 😎 (Navigation Compose,Dagger-Hilt, Mater

Feb 17, 2022

Simple implementation of a login made with jetpack compose and verifying its authentication through a REST API using retrofit

Simple implementation of a login made with jetpack compose and verifying its authentication through a REST API using retrofit

Simple Login/Auth + Jetpack Compose + Retrofit Demo 📱 Json Object Request 📑 Re

May 9, 2022

JetStrap - Ready-Made Jetpack Compose Components

JetStrap Ready-Made Jetpack Compose Components Installation implementation "com.

Jan 6, 2022

🏞 Wallpaper app made with Jetpack Compose

🏞 Wallpaper app made with Jetpack Compose

WallUp ⛰ Wallpaper finder and downloader app Demonstrate the Jetpack Compose UI using Unsplash API Made with ❤️ by Enes UI Design 🎨 Thanks to Rian Ha

May 8, 2022

Faradle - Wordle made in Jetpack Compose

Faradle - Wordle made in Jetpack Compose

Faradle The famous Wordle game created with Jetpack Compose The logic is fully u

May 13, 2022

Android App made by Jetpack Compose Components with Kotlin, MVVM Pattern, Multi Module, Navigation, Hilt, Coroutines, Retrofit and cached data by Room

Android App made by Jetpack Compose Components with Kotlin, MVVM Pattern, Multi Module, Navigation, Hilt, Coroutines, Retrofit and cached data by Room

Android App made by Jetpack Compose Components with Kotlin, MVVM Pattern, Multi Module, Navigation, Hilt, Coroutines, Retrofit and cached data by Room

Apr 17, 2022
Holi is a lightweight Jetpack Compose library of colors, gradients and cool utility functions for all your palette needs!
Holi is a lightweight Jetpack Compose library of colors, gradients and cool utility functions for all your palette needs!

Holi is a lightweight Jetpack Compose library of colors, gradients and cool utility functions for all your palette needs!

Apr 13, 2022
🎨 Jetpack Compose canvas library that helps you draw paths, images on canvas with color pickers and palettes
🎨 Jetpack Compose canvas library that helps you draw paths, images on canvas with color pickers and palettes

?? Jetpack Compose canvas library that helps you draw paths and images on canvas with color pickers and palettes. Sketchbook also provides useful components and functions that can easily interact with canvas.

May 14, 2022
Compose Curved-Scroll is an Android Jetpack Compose library made with ❤️
Compose Curved-Scroll is an Android Jetpack Compose library made with ❤️

Compose-Curved-Scroll-library Compose Curved-Scroll is an Android Jetpack Compos

Feb 17, 2022
Dynamic Badge with customizable features as max number before displaying with +, color, shadow, border, corner radius, font properties and more written with Jetpack Compose
Dynamic Badge with customizable features as max number before displaying with +, color, shadow, border, corner radius, font properties and more written with Jetpack Compose

✏️?? Dynamic Badge with customizable features as max number before displaying with +, color, shadow, border, corner radius, font properties and more written with Jetpack Compose. Displays numbers either in circle or rounded rectangle shape based on badge count and selected threshold to transform from circle to rounded rectangle.

Feb 25, 2022
Jetpack Compose Number Picker

Jetpack Compose Number Picker Android library providing a Number Picker for Jetpack Compose. Showcase Installation In your module build.gradle : depen

May 23, 2022
A diary app made by Jetpack Compose
A diary app made by Jetpack Compose

Chinese ?? ComposeDiary A simple diary app build by Jetpack Compose, use navigation library for single activity implementation Tech Stack & Features P

May 12, 2021
Lull is an Android mobile application made with Jetpack Compose, where you can download wallpapers.
Lull is an Android mobile application made with Jetpack Compose, where you can download wallpapers.

Lull Lull is an Android mobile application made with Jetpack Compose, where you can download wallpapers. Table of Contents Features Screenshots Light

Apr 4, 2022
Resume of Louis CAD, made with Jetpack Compose. Supports the Web, Desktop, and Android.
Resume of Louis CAD, made with Jetpack Compose. Supports the Web, Desktop, and Android.

ResumeComposition What This project is the source code of the resume/CV of Louis CAD. The latest PDF export is available here, it is ready to print. H

May 1, 2022
Online Furniture Shop App UI made in Jetpack Compose.
Online Furniture Shop App UI made in Jetpack Compose.

JetComposeFurnitureShopUI-Android Online Furniture Shop App UI made in Jetpack Compose with clean architecture... ?? ?? (Navigation Components, Dagger

May 1, 2022
New style for app design Online Flora Go Go App UI made in Jetpack Compose. 😉 😎
New style for app design Online Flora Go Go App UI made in Jetpack Compose. 😉 😎

JetComposeLoginUI New style for app design Online Flora Go Go App UI made in Jetpack Compose. ?? ?? (Navigation Components, Dagger-Hilt, Material Comp

Apr 19, 2022