You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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,
64
66
````
65
67
override fun onCreate() {
66
68
super.onCreate()
67
69
// 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
+
)
69
84
}
70
85
````
71
86
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