A Simple library that allows you to add dynamic colors implementation from android 5

DynamicTheme

material
API
Kotlin
Jetpack Compose
Hits

Simple library that allows you to add dynamic colors implementation from android 5 and above to your compose project. Yes! Dynamic colors are now available even on old android devices, enjoy!

Examples

See ImageResizer

20230401_211227

Attention: ColorPicker not included in the package

Features

  • Declaring custom color scheme based on upt to three colors
  • Content based colorscheme by providing bitmap
  • Dynamic themeing from android 5
  • Amoled mode support
  • Flexible api to retrieve secondary and tertiary colors from given primary color
  • Animating color scheme changes

🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥

Usage

1. Add dependencies

latestVersion
repositories {
  maven { url 'https://jitpack.io' } // Add jitpack
}
dependencies {
  implementation 'com.github.t8rin:dynamictheme:<latest_version>'
}

2. Add DynamicTheme call

@Composable
fun DynamicThemeComposable() {

    DynamicTheme(
        state = rememberDynamicThemeState(),
        defaultColorTuple = ColorTuple(
            primary = /*your value*/,
            secondary = /*your value (optional)*/,
            tertiary = /*your value (optional)*/
        ),
        content = {
            /*your content
            * there you can get you provided state value by LocalDynamicThemeState.current
            */
        }
    )
    
    //...
    // Also you can use ColorTupleItem to get represenation of your color scheme by three colors

Roadmap

  • Rewrite to Kotlin

Find this repository useful? ❤️

Support it by joining stargazers for this repository. ⭐ And follow me for my next creations! 🤩

License

Designed and developed by 2023 T8RIN

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

View Github

Leave a Reply

Your email address will not be published. Required fields are marked *