Skip to content

Commit 9a31bca

Browse files
committed
Update the README.md with new 3.0.0 changes
1 parent 382990e commit 9a31bca

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ Add the following dependency to your `build.gradle` / `build.gradle.kts` file:
2626
For Groovy - `build.gradle`:
2727
````
2828
dependencies {
29-
implementation 'com.github.KvColorPalette:KvColorPalette-Android:2.2.0'
29+
implementation 'com.github.KvColorPalette:KvColorPalette-Android:3.0.0'
3030
}
3131
````
3232
For Kotlin DSL - `build.gradle.kts`:
3333
````
3434
dependencies {
35-
implementation("com.github.KvColorPalette:KvColorPalette-Android:2.2.0")
35+
implementation("com.github.KvColorPalette:KvColorPalette-Android:3.0.0")
3636
}
3737
````
3838

@@ -60,12 +60,27 @@ KvColorPalette.instance.generateThemeColorSchemePalette(givenColor = MatPackage(
6060

6161
### Advance Usage
6262
If you wants to use `KvColorPalette-Android` to generate your theme color palette when your application start-up, then you have to initiate the library in Application level.
63-
To initiate you have to pass one base color that you think your application will use. Use following code to initiate the library package.
63+
There are two ways to initiate the library. These two methods for two different scenarios. First is to initiate the library with one base color and other is to initiate the library with two base colors.
64+
In two color method, there are additional parameters like `bias` and `themeGenPattern`.
65+
If your application styling with one base color then you can use following method to initialized,
6466
````
6567
override fun onCreate() {
6668
super.onCreate()
6769
// Initialize the KvColorPalette-Android
68-
KvColorPalette.initialize(Color.blue)
70+
KvColorPalette.initialize(baseColor = Color.blue)
71+
}
72+
````
73+
If your application has two base colors, then you can use following method to initialized,
74+
````
75+
override fun onCreate() {
76+
super.onCreate()
77+
// Initialize the KvColorPalette-Android
78+
KvColorPalette.initialize(
79+
baseColor = Color.blue,
80+
secondColor = Color.red,
81+
themeGenPattern = ThemeGenMode.BLEND // The way to generate the theme palette using two colors.
82+
bias = 0.5f, // How bias to first or second color
83+
)
6984
}
7085
````
7186
This initiation create a color schemas for a theme using the given color at the initiation. This generated color schemas will available for light and dark theme variants.

0 commit comments

Comments
 (0)