Skip to content

Commit

Permalink
Added dracula-theme, like in thumb-key (#1218)
Browse files Browse the repository at this point in the history
* Added dracula-theme, like in thumb-key

* Fixed pipeline errors

* Added additional values for Dracula Theme in strings.xml and Utils.kt

* empty commit to wake the woodpecker

* removed needless blank line
  • Loading branch information
0xFOSSMan authored Sep 5, 2023
1 parent 86674b9 commit bbab09b
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/java/com/jerboa/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ enum class ThemeColor(val mode: Int) {
Pink(R.string.look_and_feel_theme_color_pink),
Purple(R.string.look_and_feel_theme_color_purple),
Woodland(R.string.look_and_feel_theme_color_woodland),
Dracula(R.string.look_and_feel_theme_color_dracula),
}

enum class PostViewMode(val mode: Int) {
Expand Down
146 changes: 146 additions & 0 deletions app/src/main/java/com/jerboa/ui/theme/Color.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,152 @@ fun woodland(): Pair<JerboaColorScheme, JerboaColorScheme> {
return Pair(jerboaLight, jerboaDark)
}

fun dracula(): Pair<JerboaColorScheme, JerboaColorScheme> {
val md_theme_light_primary = Color(0xFF4758A9)
val md_theme_light_onPrimary = Color(0xFFFFFFFF)
val md_theme_light_primaryContainer = Color(0xFFDDE1FF)
val md_theme_light_onPrimaryContainer = Color(0xFF001257)
val md_theme_light_secondary = Color(0xFF5A5D72)
val md_theme_light_onSecondary = Color(0xFFFFFFFF)
val md_theme_light_secondaryContainer = Color(0xFFDFE1F9)
val md_theme_light_onSecondaryContainer = Color(0xFF171B2C)
val md_theme_light_tertiary = Color(0xFF76546E)
val md_theme_light_onTertiary = Color(0xFFFFFFFF)
val md_theme_light_tertiaryContainer = Color(0xFFFFD7F2)
val md_theme_light_onTertiaryContainer = Color(0xFF2D1228)
val md_theme_light_error = Color(0xFFBA1A1A)
val md_theme_light_errorContainer = Color(0xFFFFDAD6)
val md_theme_light_onError = Color(0xFFFFFFFF)
val md_theme_light_onErrorContainer = Color(0xFF410002)
val md_theme_light_background = Color(0xFFFEFBFF)
val md_theme_light_onBackground = Color(0xFF1B1B1F)
val md_theme_light_surface = Color(0xFFFEFBFF)
val md_theme_light_onSurface = Color(0xFF1B1B1F)
val md_theme_light_surfaceVariant = Color(0xFFE3E1EC)
val md_theme_light_onSurfaceVariant = Color(0xFF45464F)
val md_theme_light_outline = Color(0xFF767680)
val md_theme_light_inverseOnSurface = Color(0xFFF3F0F4)
val md_theme_light_inverseSurface = Color(0xFF303034)
val md_theme_light_inversePrimary = Color(0xFFB9C3FF)
val md_theme_light_shadow = Color(0xFF000000)
val md_theme_light_surfaceTint = Color(0xFF4758A9)
val md_theme_light_outlineVariant = Color(0xFFC6C5D0)
val md_theme_light_scrim = Color(0xFF000000)

val md_theme_dark_primary = Color(0xFFB9C3FF)
val md_theme_dark_onPrimary = Color(0xFF132778)
val md_theme_dark_primaryContainer = Color(0xFF2E4090)
val md_theme_dark_onPrimaryContainer = Color(0xFFDDE1FF)
val md_theme_dark_secondary = Color(0xFFC3C5DD)
val md_theme_dark_onSecondary = Color(0xFF2C2F42)
val md_theme_dark_secondaryContainer = Color(0xFF434659)
val md_theme_dark_onSecondaryContainer = Color(0xFFDFE1F9)
val md_theme_dark_tertiary = Color(0xFFE5BAD8)
val md_theme_dark_onTertiary = Color(0xFF44263E)
val md_theme_dark_tertiaryContainer = Color(0xFF5C3C55)
val md_theme_dark_onTertiaryContainer = Color(0xFFFFD7F2)
val md_theme_dark_error = Color(0xFFFFB4AB)
val md_theme_dark_errorContainer = Color(0xFF93000A)
val md_theme_dark_onError = Color(0xFF690005)
val md_theme_dark_onErrorContainer = Color(0xFFFFDAD6)
val md_theme_dark_background = Color(0xFF1B1B1F)
val md_theme_dark_onBackground = Color(0xFFE4E1E6)
val md_theme_dark_surface = Color(0xFF1B1B1F)
val md_theme_dark_onSurface = Color(0xFFE4E1E6)
val md_theme_dark_surfaceVariant = Color(0xFF45464F)
val md_theme_dark_onSurfaceVariant = Color(0xFFC6C5D0)
val md_theme_dark_outline = Color(0xFF90909A)
val md_theme_dark_inverseOnSurface = Color(0xFF1B1B1F)
val md_theme_dark_inverseSurface = Color(0xFFE4E1E6)
val md_theme_dark_inversePrimary = Color(0xFF4758A9)
val md_theme_dark_shadow = Color(0xFF000000)
val md_theme_dark_surfaceTint = Color(0xFFB9C3FF)
val md_theme_dark_outlineVariant = Color(0xFF45464F)
val md_theme_dark_scrim = Color(0xFF000000)
val jerboa_image_highlight = Color(0xCCD1D1D1)
val jerboa_video_highlight = Color(0xCCC20000)

// val seed = Color(0xFF44475A)

val light = lightColorScheme(
primary = md_theme_light_primary,
onPrimary = md_theme_light_onPrimary,
primaryContainer = md_theme_light_primaryContainer,
onPrimaryContainer = md_theme_light_onPrimaryContainer,
secondary = md_theme_light_secondary,
onSecondary = md_theme_light_onSecondary,
secondaryContainer = md_theme_light_secondaryContainer,
onSecondaryContainer = md_theme_light_onSecondaryContainer,
tertiary = md_theme_light_tertiary,
onTertiary = md_theme_light_onTertiary,
tertiaryContainer = md_theme_light_tertiaryContainer,
onTertiaryContainer = md_theme_light_onTertiaryContainer,
error = md_theme_light_error,
errorContainer = md_theme_light_errorContainer,
onError = md_theme_light_onError,
onErrorContainer = md_theme_light_onErrorContainer,
background = md_theme_light_background,
onBackground = md_theme_light_onBackground,
surface = md_theme_light_surface,
onSurface = md_theme_light_onSurface,
surfaceVariant = md_theme_light_surfaceVariant,
onSurfaceVariant = md_theme_light_onSurfaceVariant,
outline = md_theme_light_outline,
inverseOnSurface = md_theme_light_inverseOnSurface,
inverseSurface = md_theme_light_inverseSurface,
inversePrimary = md_theme_light_inversePrimary,
surfaceTint = md_theme_light_surfaceTint,
outlineVariant = md_theme_light_outlineVariant,
scrim = md_theme_light_scrim,
)

val dark = darkColorScheme(
primary = md_theme_dark_primary,
onPrimary = md_theme_dark_onPrimary,
primaryContainer = md_theme_dark_primaryContainer,
onPrimaryContainer = md_theme_dark_onPrimaryContainer,
secondary = md_theme_dark_secondary,
onSecondary = md_theme_dark_onSecondary,
secondaryContainer = md_theme_dark_secondaryContainer,
onSecondaryContainer = md_theme_dark_onSecondaryContainer,
tertiary = md_theme_dark_tertiary,
onTertiary = md_theme_dark_onTertiary,
tertiaryContainer = md_theme_dark_tertiaryContainer,
onTertiaryContainer = md_theme_dark_onTertiaryContainer,
error = md_theme_dark_error,
errorContainer = md_theme_dark_errorContainer,
onError = md_theme_dark_onError,
onErrorContainer = md_theme_dark_onErrorContainer,
background = md_theme_dark_background,
onBackground = md_theme_dark_onBackground,
surface = md_theme_dark_surface,
onSurface = md_theme_dark_onSurface,
surfaceVariant = md_theme_dark_surfaceVariant,
onSurfaceVariant = md_theme_dark_onSurfaceVariant,
outline = md_theme_dark_outline,
inverseOnSurface = md_theme_dark_inverseOnSurface,
inverseSurface = md_theme_dark_inverseSurface,
inversePrimary = md_theme_dark_inversePrimary,
surfaceTint = md_theme_dark_surfaceTint,
outlineVariant = md_theme_dark_outlineVariant,
scrim = md_theme_dark_scrim,
)

val jerboaLight = JerboaColorScheme(
material = light,
imageHighlight = jerboa_image_highlight,
videoHighlight = jerboa_video_highlight,
)

val jerboaDark = JerboaColorScheme(
material = dark,
imageHighlight = jerboa_image_highlight,
videoHighlight = jerboa_video_highlight,
)

return Pair(jerboaLight, jerboaDark)
}

val Color.muted get() = this.copy(alpha = 0.5F)

val CARD_COLORS @Composable
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/jerboa/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ fun JerboaTheme(
ThemeColor.Pink -> pink()
ThemeColor.Purple -> purple()
ThemeColor.Woodland -> woodland()
ThemeColor.Dracula -> dracula()
}

fun makeBlack(darkTheme: JerboaColorScheme): JerboaColorScheme {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
<string name="look_and_feel_theme_color_pink">Pink</string>
<string name="look_and_feel_theme_color_purple">Purple</string>
<string name="look_and_feel_theme_color_woodland">Woodland</string>
<string name="look_and_feel_theme_color_dracula">Dracula</string>
<string name="look_and_feel_use_custom_tabs">Use custom tabs</string>
<string name="look_and_feel_use_private_tabs">Use private tabs if available</string>
<string name="markRead">Mark as read</string>
Expand Down

0 comments on commit bbab09b

Please sign in to comment.