Adding 2 new themes

More color options with Midnight Dusk (From SY, jobobby04@4b3d92a050fb694de8b5001 )
Also adding a light version called Spring Blossom

This relates to #719 but the next commit will be the one for it

Co-Authored-By: CrepeTF <70870719+CrepeTF@users.noreply.github.com>
This commit is contained in:
Jays2Kings 2021-04-10 17:04:15 -04:00
parent 254e2a90dd
commit b7b8c61533
5 changed files with 69 additions and 4 deletions

View File

@ -57,9 +57,20 @@ object ThemeUtil {
}
}
@Suppress("unused")
enum class Themes(@StyleRes val styleRes: Int, val nightMode: Int, @StringRes val nameRes: Int) {
PURE_WHITE(R.style.Theme_Tachiyomi, AppCompatDelegate.MODE_NIGHT_NO, R.string.white_theme),
DARK(R.style.Theme_Tachiyomi, AppCompatDelegate.MODE_NIGHT_YES, R.string.dark),
SPRING(
R.style.Theme_Tachiyomi_MidnightDusk,
AppCompatDelegate.MODE_NIGHT_NO,
R.string.spring_blossom
),
DUSK(
R.style.Theme_Tachiyomi_MidnightDusk,
AppCompatDelegate.MODE_NIGHT_YES,
R.string.midnight_dusk
),
AMOLED(
R.style.Theme_Tachiyomi_Amoled,
AppCompatDelegate.MODE_NIGHT_YES,
@ -117,7 +128,12 @@ object ThemeUtil {
}
@ColorInt
val lightPrimaryText: Int = Color.parseColor("#DE000000")
val lightPrimaryText: Int = Color.parseColor(
when (styleRes) {
R.style.Theme_Tachiyomi_MidnightDusk -> "#DE240728"
else -> "#DE000000"
}
)
@ColorInt
val darkPrimaryText: Int = Color.parseColor("#FFFFFFFF")
@ -129,21 +145,37 @@ object ThemeUtil {
val darkSecondaryText: Int = ColorUtils.setAlphaComponent(darkPrimaryText, (0.54f * 255f).roundToInt())
@ColorInt
val lightBackground: Int = Color.parseColor("#FAFAFA")
val lightBackground: Int = Color.parseColor(
when (styleRes) {
R.style.Theme_Tachiyomi_MidnightDusk -> "#f6f0f8"
else -> "#FAFAFA"
}
)
@ColorInt
val darkBackground: Int = Color.parseColor(
when (styleRes) {
R.style.Theme_Tachiyomi_Amoled -> "#000000"
R.style.Theme_Tachiyomi_MidnightDusk -> "#16151D"
else -> "#1C1C1D"
}
)
@ColorInt
val lightAccent: Int = Color.parseColor("#2979FF")
val lightAccent: Int = Color.parseColor(
when (styleRes) {
R.style.Theme_Tachiyomi_MidnightDusk -> "#c43c97"
else -> "#2979FF"
}
)
@ColorInt
val darkAccent: Int = Color.parseColor("#3399FF")
val darkAccent: Int = Color.parseColor(
when (styleRes) {
R.style.Theme_Tachiyomi_MidnightDusk -> "#F02475"
else -> "#3399FF"
}
)
@ColorInt
val lightAppBar: Int = when (styleRes) {
@ -160,6 +192,7 @@ object ThemeUtil {
@ColorInt
val lightAppBarText: Int = when (styleRes) {
R.style.Theme_Tachiyomi_AllBlue -> Color.parseColor("#FFFFFF")
R.style.Theme_Tachiyomi_MidnightDusk -> Color.parseColor("#DE4c0d4b")
else -> lightPrimaryText
}
@ -173,6 +206,7 @@ object ThemeUtil {
val lightBottomBar: Int = Color.parseColor(
when (styleRes) {
R.style.Theme_Tachiyomi_AllBlue -> "#54759E"
R.style.Theme_Tachiyomi_MidnightDusk -> "#efe3f3"
else -> "#FFFFFF"
}
)
@ -182,6 +216,7 @@ object ThemeUtil {
when (styleRes) {
R.style.Theme_Tachiyomi_AllBlue -> "#54759E"
R.style.Theme_Tachiyomi_Amoled -> "#000000"
R.style.Theme_Tachiyomi_MidnightDusk -> "#201F27"
else -> "#212121"
}
)

View File

@ -23,4 +23,12 @@
<color name="background">#1C1C1D</color>
<color name="dialog">#212121</color>
<color name="gray_button">#BFBFBF</color>
<!-- Midnight Dusk Theme -->
<color name="colorAccentDuskDawn">#F02475</color>
<color name="colorAccentDuskDawnText">#f091b7</color>
<color name="backgroundDuskDawn">#16151D</color>
<color name="dialogDuskDawn">#201F27</color>
<color name="textPrimaryDuskDawn">@color/md_white_1000</color>
<color name="appBarTextDuskDawn">@color/md_white_1000</color>
</resources>

View File

@ -67,4 +67,12 @@
<color name="navigation_next">#CCA6CFD5</color>
<color name="navigation_prev">#CC7D1128</color>
<!-- Spring Blossom -->
<color name="colorAccentDuskDawn">#c43c97</color>
<color name="colorAccentDuskDawnText">#803d6a</color>
<color name="backgroundDuskDawn">#f7f4f8</color>
<color name="dialogDuskDawn">#efe3f3</color>
<color name="textPrimaryDuskDawn">#DE240728</color>
<color name="appBarTextDuskDawn">#DE4c0d4b</color>
</resources>

View File

@ -566,6 +566,8 @@
<string name="dark">Dark</string>
<string name="amoled_black">AMOLED Black</string>
<string name="dark_blue">Dark Blue</string>
<string name="midnight_dusk">Midnight Dusk</string>
<string name="spring_blossom">Spring Blossom</string>
<string name="white_theme">Pure White</string>
<string name="system_default_amoled">System default (White + Black)</string>
<string name="system_default_all_blue">System default (All Blue)</string>

View File

@ -69,6 +69,18 @@
<item name="android:windowLightNavigationBar" tools:targetApi="27">false</item>
</style>
<style name="Theme.Tachiyomi.Amoled" parent="Theme.Tachiyomi"/>
<style name="Theme.Tachiyomi.MidnightDusk" parent="Theme.Tachiyomi">
<item name="colorPrimary">@color/dialogDuskDawn</item>
<item name="colorPrimaryDark">@color/dialogDuskDawn</item>
<item name="colorAccent">@color/colorAccentDuskDawn</item>
<item name="colorAccentText">@color/colorAccentDuskDawnText</item>
<item name="colorPrimaryVariant">@color/dialogDuskDawn</item>
<item name="colorSecondary">@color/backgroundDuskDawn</item>
<item name="background">@color/backgroundDuskDawn</item>
<item name="android:textColorPrimary">@color/textPrimaryDuskDawn</item>
<item name="android:colorBackground">@color/backgroundDuskDawn</item>
<item name="actionBarTintColor">@color/appBarTextDuskDawn</item>
</style>
<!--===============-->
<!-- Launch Screen -->