🌈 Palette - A color picker library made in Jetpack Compose

Overview

🌈 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.
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}"

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

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

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

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

JetStrap - Ready-Made Jetpack Compose Components

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

🏞 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

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

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

Releases(0.0.4)
Owner
Shivam Dhuria
I like building stuff
Shivam Dhuria
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!

Sid Patil 167 Dec 5, 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 and images on canvas with color pickers and palettes. Sketchbook also provides useful components and functions that can easily interact with canvas.

Stream 342 Dec 30, 2022
Compose Curved-Scroll is an Android Jetpack Compose library made with ❀️

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

mohamed tamer 23 Aug 24, 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. Displays numbers either in circle or rounded rectangle shape based on badge count and selected threshold to transform from circle to rounded rectangle.

Smart Tool Factory 4 Jul 27, 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

Chargemap 140 Jan 2, 2023
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

RERERE 4 Jun 7, 2022
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

Simge Şengün 12 Oct 10, 2022
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

Louis CAD 22 Aug 14, 2022
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

Arvind Meshram 30 Dec 19, 2022
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

Arvind Meshram 95 Dec 22, 2022