Skip to content

Commit 8fd91ea

Browse files
committed
Color Pallet: Update the README.md for new changes in KvColorPallet-Android library
1 parent a14815c commit 8fd91ea

File tree

1 file changed

+35
-9
lines changed

1 file changed

+35
-9
lines changed

README.md

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# KV Android Color Pallet
1+
# KV Color Pallet - Android
22

33
This is a lightweight Android library that generates a color palette from a given color and creates a theme color set for Android applications.
44
This library simplifies the process of building consistent and visually appealing color themes.
@@ -24,29 +24,55 @@ Add the following dependency to your `build.gradle` / `build.gradle.kts` file:
2424
For Groovy - `build.gradle`:
2525
````
2626
dependencies {
27-
implementation 'com.github.kavi707:kv-android-color-pallet:0.0.2'
27+
implementation 'com.github.kavi707:kv-android-color-pallet:0.0.3'
2828
}
2929
````
3030
For Kotlin DSL - `build.gradle.kts`:
3131
````
3232
dependencies {
33-
implementation("com.github.kavi707:kv-android-color-pallet:0.0.2")
33+
implementation("com.github.kavi707:kv-android-color-pallet:0.0.3")
3434
}
3535
````
3636

3737
# Usage
38-
### Initiate
39-
On usage of the kv-android-color-pallet, from your application class, Initiate it using following code.
40-
While initiating, you have to parse a color (androidx.compose.ui.graphics.Color) that you prefer to use as your primary color in your application.
38+
After you integrated the `KvColorPallet-Android` library, you can consume it as follows.
39+
40+
### Basic Usage
41+
If you wants to consume basic features in `KvColorPallet` then use singleton instance as follows. This singleton instance allows consumers to access following basic functionalities.
42+
```
43+
// Generate alpha color schem of given color
44+
KvColorPallet.instance.generateAlphaColorPallet(givenColor: MatPackage().matGold.color)
45+
46+
// Generate mat color schem of given color
47+
KvColorPallet.instance.generateColorPallet(givenColor: MatPackage().matGold)
48+
49+
// Generate theme color pallet of given color
50+
KvColorPallet.instance.generateThemeColorPallet(givenColor: MatPackage().matGold.color)
51+
```
52+
53+
### Advance Usage
54+
If you wants to use `KvColorPallet-Android` to generate your theme color pallet when your application start-up, then you have to initiate the library in Application level.
55+
To initiate you have to pass one base color that you think your application will use. Use following code to initiate the library package.
4156
````
4257
override fun onCreate() {
4358
super.onCreate()
4459
// Initialize the kv-android-color-pallet
45-
KvColorPallet.init(MatPackage.MatDGreen.color)
60+
KvColorPallet.initialize(MatPackage.MatDGreen)
4661
}
4762
````
48-
This initiation create a color set for a theme using the given color at the initiation.
49-
This generated color set available for light and dark theme variants.
63+
This initiation create a color set for a theme using the given color at the initiation. This generated color set available for light and dark theme variants.
64+
65+
In this `KvColorPallet.appThemePallet` you will have following color attributes.
66+
|Attribute |light-theme |dark-theme |Description |
67+
|-------------|------------|------------|--------------|
68+
|.base |original |original |This is the base color given by the user. |
69+
|.primary |available |available |Suggesting primary color. This color can use for buttons, major component etc. |
70+
|.secondary |available |available |Suggesting secondary color. For any the secondary components which should not use by primary color. |
71+
|.tertiary |available |available |Suggesting tertiary color. |
72+
|.background |available |available |Suggesting background color. |
73+
|.onPrimary |available |available |This is the color you can use on any component use primary color. |
74+
|.onSecondary |available |available |This is the color you can use on any component use secondary color. |
75+
|.shadow |available |available |This is the color for your shadows. |
5076

5177
### Use generated theme
5278
As mentioned above, according to the initiation color, that generate the color set for light and dark them.

0 commit comments

Comments
 (0)