added icon color changer everywhere

This commit is contained in:
Kima 2023-10-12 19:24:40 +02:00
parent 46e6120af3
commit 5272ac5a01
3 changed files with 33 additions and 4 deletions

View File

@ -40,6 +40,11 @@ class ShareProvider extends ChangeNotifier {
SettingsProvider.defaultSettings().customAccentColor)
?.value ??
const Color(0xFF3D7BF4).value,
'icon_color': (settings.customIconColor ??
SettingsProvider.defaultSettings().customIconColor)
?.value ??
const Color(0x00000000).value,
'shadow_effect': settings.shadowEffect,
};
SharedTheme theme = SharedTheme.fromJson(themeJson, gradeColors);

View File

@ -39,6 +39,7 @@ enum CustomColorMode {
accent,
background,
highlight,
icon,
enterId,
}
@ -146,6 +147,8 @@ class _PremiumCustomAccentColorSettingState
return settings.customHighlightColor;
case CustomColorMode.accent:
return settings.customAccentColor;
case CustomColorMode.icon:
return settings.customIconColor;
case CustomColorMode.enterId:
// do nothing here lol
break;
@ -153,7 +156,7 @@ class _PremiumCustomAccentColorSettingState
}
void updateCustomColor(dynamic v, bool store,
{Color? accent, Color? background, Color? panels}) {
{Color? accent, Color? background, Color? panels, Color? icon}) {
if (colorMode != CustomColorMode.theme) {
settings.update(accentColor: AccentColor.custom, store: store);
}
@ -186,10 +189,14 @@ class _PremiumCustomAccentColorSettingState
case CustomColorMode.accent:
settings.update(customAccentColor: v, store: store);
break;
case CustomColorMode.icon:
settings.update(customIconColor: v, store: store);
break;
case CustomColorMode.enterId:
settings.update(customBackgroundColor: background, store: store);
settings.update(customHighlightColor: panels, store: store);
settings.update(customAccentColor: accent, store: store);
settings.update(customIconColor: icon, store: store);
break;
}
}
@ -329,7 +336,8 @@ class _PremiumCustomAccentColorSettingState
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24),
gradient: LinearGradient( // https://discord.com/channels/1111649116020285532/1153619667848548452
gradient: LinearGradient(
// https://discord.com/channels/1111649116020285532/1153619667848548452
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
stops: const [
@ -337,8 +345,8 @@ class _PremiumCustomAccentColorSettingState
0.75
],
colors: [
settings.customBackgroundColor
?? Theme.of(context).colorScheme.background,
settings.customBackgroundColor ??
Theme.of(context).colorScheme.background,
isBackgroundDifferent
? HSVColor.fromColor(Theme.of(context)
.colorScheme
@ -704,6 +712,13 @@ class _PremiumCustomAccentColorSettingState
tab: Tab(
text: "colorpicker_accent"
.i18n)),
ColorTab(
unlocked: hasAccess,
color: settings.customIconColor ??
unknownColor,
tab: Tab(
text:
"colorpicker_icon".i18n)),
],
onTap: (index) {
if (!hasAccess) {
@ -824,6 +839,11 @@ class _PremiumCustomAccentColorSettingState
settings.update(
gradeColors: colors);
// changing shadow effect
settings.update(
shadowEffect:
theme.shadowEffect);
// changing theme
setState(() {
updateCustomColor(
@ -833,6 +853,7 @@ class _PremiumCustomAccentColorSettingState
background:
theme.backgroundColor,
panels: theme.panelsColor,
icon: theme.iconColor,
);
});
setTheme(settings.theme, true);

View File

@ -9,6 +9,7 @@ extension SettingsLocalization on String {
"colorpicker_background": "Background",
"colorpicker_panels": "Panels",
"colorpicker_accent": "Accent",
"colorpicker_icon": "Icon",
"need_sub": "You need Kupak subscription to use modify this.",
"advanced": "Advanced",
"enter_id": "Enter ID",
@ -25,6 +26,7 @@ extension SettingsLocalization on String {
"colorpicker_background": "Háttér",
"colorpicker_panels": "Panelek",
"colorpicker_accent": "Színtónus",
"colorpicker_icon": "Ikon",
"need_sub": "A módosításhoz Kupak szintű támogatás szükséges.",
"advanced": "Haladó",
"enter_id": "ID megadása",
@ -41,6 +43,7 @@ extension SettingsLocalization on String {
"colorpicker_background": "Hintergrund",
"colorpicker_panels": "Tafeln",
"colorpicker_accent": "Akzent",
"colorpicker_icon": "Ikone",
"need_sub":
"Sie benötigen ein Kupak-Abonnement, um diese Funktion zu ändern.",
"advanced": "Fortschrittlich",