garretyoder / Colorful

Android runtime theme library
Apache License 2.0
2.13k stars 193 forks source link

Request to add color #34

Closed tcqq closed 6 years ago

tcqq commented 6 years ago

@garretyoder Request to add DARK_GREY, because use "DARK_GREY" color in dark theme is best choose, thanks. image image image

garretyoder commented 6 years ago

I will not be adding any further colors simply because I have chosen to adhere to the material color pallet

However, thanks to a helpful commit(#29) you can now define your own custom colors and mix them with Colorful's defaults. See the readme on how to accomplish this.

tcqq commented 6 years ago

@garretyoder Thanks:), but I found a problem, I set colorPrimaryDark to red, but it not work. image

If this value is accentColor, it also not work.

ThemeColorInterface themeColor = new CustomThemeColor(
    getContext(),
    R.style.dark_grey_primary_color,
    R.style.dark_grey_primary_dark_color,
    R.color.dark_gray,
    R.color.red);
Colorful().edit()
    .setPrimaryColor(themeColor)
    .apply(getContext(), () -> {
      recreate();
      return null;
})).isDisposed();
    <style name="dark_grey_primary_color">
        <item name="colorPrimary">@color/dark_gray</item>
    </style>
    <style name="dark_grey_primary_dark_color">
        <item name="colorPrimaryDark">@color/red</item>
    </style>
tcqq commented 6 years ago

I am using this method to set colorPrimaryDark now.

ThemeColorInterface themeColor = new CustomThemeColor(
    getContext(),
    R.style.dark_grey_primary_color,
    0,
    R.color.dark_gray,
    R.color.red);
    <style name="dark_grey_primary_color">
        <item name="colorPrimary">@color/dark_gray</item>
        <item name="colorPrimaryDark">@color/red</item>
    </style>