|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'app_colors.dart';
|
|
|
|
|
|
|
|
/// Semantic colors extension for Double Feel application.
|
|
|
|
/// Exposes structured colors and gradients supporting Light and Dark modes.
|
|
|
|
class AppColorsExtension extends ThemeExtension<AppColorsExtension> {
|
|
|
|
// Brand Colors
|
|
|
|
final Color primary;
|
|
|
|
|
|
|
|
// Text & Border Colors
|
|
|
|
final Color textPrimary;
|
|
|
|
final Color textSecondary;
|
|
|
|
final Color textTertiary;
|
|
|
|
final Color disabled;
|
|
|
|
final Color border;
|
|
|
|
|
|
|
|
// Chart & Features Colors
|
|
|
|
final Color chartPink;
|
|
|
|
final Color chartOrange;
|
|
|
|
final Color chartBlue;
|
|
|
|
final Color chartGreen;
|
|
|
|
final Color chartPurple;
|
|
|
|
final Color chartMagenta;
|
|
|
|
|
|
|
|
// VIP Colors
|
|
|
|
final Color vipText;
|
|
|
|
final Color vipGold;
|
|
|
|
final Color vipPurple;
|
|
|
|
|
|
|
|
// Auxiliary Colors
|
|
|
|
final Color backgroundLight;
|
|
|
|
final Color brandBackgroundLight;
|
|
|
|
|
|
|
|
// Gradients
|
|
|
|
final LinearGradient brandBackgroundGradient;
|
|
|
|
|
|
|
|
const AppColorsExtension({
|
|
|
|
required this.primary,
|
|
|
|
required this.textPrimary,
|
|
|
|
required this.textSecondary,
|
|
|
|
required this.textTertiary,
|
|
|
|
required this.disabled,
|
|
|
|
required this.border,
|
|
|
|
required this.chartPink,
|
|
|
|
required this.chartOrange,
|
|
|
|
required this.chartBlue,
|
|
|
|
required this.chartGreen,
|
|
|
|
required this.chartPurple,
|
|
|
|
required this.chartMagenta,
|
|
|
|
required this.vipText,
|
|
|
|
required this.vipGold,
|
|
|
|
required this.vipPurple,
|
|
|
|
required this.backgroundLight,
|
|
|
|
required this.brandBackgroundLight,
|
|
|
|
required this.brandBackgroundGradient,
|
|
|
|
});
|
|
|
|
|
|
|
|
/// The standard light palette derived directly from Figma.
|
|
|
|
factory AppColorsExtension.light() {
|
|
|
|
return const AppColorsExtension(
|
|
|
|
primary: AppColors.primary,
|
|
|
|
textPrimary: AppColors.textPrimary,
|
|
|
|
textSecondary: AppColors.textSecondary,
|
|
|
|
textTertiary: AppColors.textTertiary,
|
|
|
|
disabled: AppColors.disabled,
|
|
|
|
border: AppColors.border,
|
|
|
|
chartPink: AppColors.chartPink,
|
|
|
|
chartOrange: AppColors.chartOrange,
|
|
|
|
chartBlue: AppColors.chartBlue,
|
|
|
|
chartGreen: AppColors.chartGreen,
|
|
|
|
chartPurple: AppColors.chartPurple,
|
|
|
|
chartMagenta: AppColors.chartMagenta,
|
|
|
|
vipText: AppColors.vipText,
|
|
|
|
vipGold: AppColors.vipGold,
|
|
|
|
vipPurple: AppColors.vipPurple,
|
|
|
|
backgroundLight: AppColors.backgroundLight,
|
|
|
|
brandBackgroundLight: AppColors.brandBackgroundLight,
|
|
|
|
brandBackgroundGradient: LinearGradient(
|
|
|
|
colors: [AppColors.gradientStart, AppColors.gradientEnd],
|
|
|
|
begin: Alignment.centerLeft,
|
|
|
|
end: Alignment.centerRight,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Initial dark mode mapping. Semantic mappings adapt nicely when Dark mode is toggled.
|
|
|
|
factory AppColorsExtension.dark() {
|
|
|
|
return const AppColorsExtension(
|
|
|
|
primary: AppColors.primary,
|
|
|
|
textPrimary: Color(0xFFEEEEEE),
|
|
|
|
textSecondary: Color(0xFFAAAAAA),
|
|
|
|
textTertiary: Color(0xFF666666),
|
|
|
|
disabled: Color(0xFF444444),
|
|
|
|
border: Color(0xFF333333),
|
|
|
|
chartPink: AppColors.chartPink,
|
|
|
|
chartOrange: AppColors.chartOrange,
|
|
|
|
chartBlue: AppColors.chartBlue,
|
|
|
|
chartGreen: AppColors.chartGreen,
|
|
|
|
chartPurple: AppColors.chartPurple,
|
|
|
|
chartMagenta: AppColors.chartMagenta,
|
|
|
|
vipText: Color(0xFFEEEEEE),
|
|
|
|
vipGold: AppColors.vipGold,
|
|
|
|
vipPurple: AppColors.vipPurple,
|
|
|
|
backgroundLight: Color(0xFF121214),
|
|
|
|
brandBackgroundLight: Color(0xFF241C35),
|
|
|
|
brandBackgroundGradient: LinearGradient(
|
|
|
|
colors: [Color(0xFF241C35), Color(0xFF1A1525)],
|
|
|
|
begin: Alignment.centerLeft,
|
|
|
|
end: Alignment.centerRight,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
AppColorsExtension copyWith({
|
|
|
|
Color? primary,
|
|
|
|
Color? textPrimary,
|
|
|
|
Color? textSecondary,
|
|
|
|
Color? textTertiary,
|
|
|
|
Color? disabled,
|
|
|
|
Color? border,
|
|
|
|
Color? chartPink,
|
|
|
|
Color? chartOrange,
|
|
|
|
Color? chartBlue,
|
|
|
|
Color? chartGreen,
|
|
|
|
Color? chartPurple,
|
|
|
|
Color? chartMagenta,
|
|
|
|
Color? vipText,
|
|
|
|
Color? vipGold,
|
|
|
|
Color? vipPurple,
|
|
|
|
Color? backgroundLight,
|
|
|
|
Color? brandBackgroundLight,
|
|
|
|
LinearGradient? brandBackgroundGradient,
|
|
|
|
}) {
|
|
|
|
return AppColorsExtension(
|
|
|
|
primary: primary ?? this.primary,
|
|
|
|
textPrimary: textPrimary ?? this.textPrimary,
|
|
|
|
textSecondary: textSecondary ?? this.textSecondary,
|
|
|
|
textTertiary: textTertiary ?? this.textTertiary,
|
|
|
|
disabled: disabled ?? this.disabled,
|
|
|
|
border: border ?? this.border,
|
|
|
|
chartPink: chartPink ?? this.chartPink,
|
|
|
|
chartOrange: chartOrange ?? this.chartOrange,
|
|
|
|
chartBlue: chartBlue ?? this.chartBlue,
|
|
|
|
chartGreen: chartGreen ?? this.chartGreen,
|
|
|
|
chartPurple: chartPurple ?? this.chartPurple,
|
|
|
|
chartMagenta: chartMagenta ?? this.chartMagenta,
|
|
|
|
vipText: vipText ?? this.vipText,
|
|
|
|
vipGold: vipGold ?? this.vipGold,
|
|
|
|
vipPurple: vipPurple ?? this.vipPurple,
|
|
|
|
backgroundLight: backgroundLight ?? this.backgroundLight,
|
|
|
|
brandBackgroundLight: brandBackgroundLight ?? this.brandBackgroundLight,
|
|
|
|
brandBackgroundGradient: brandBackgroundGradient ?? this.brandBackgroundGradient,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
AppColorsExtension lerp(ThemeExtension<AppColorsExtension>? other, double t) {
|
|
|
|
if (other is! AppColorsExtension) {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
return AppColorsExtension(
|
|
|
|
primary: Color.lerp(primary, other.primary, t)!,
|
|
|
|
textPrimary: Color.lerp(textPrimary, other.textPrimary, t)!,
|
|
|
|
textSecondary: Color.lerp(textSecondary, other.textSecondary, t)!,
|
|
|
|
textTertiary: Color.lerp(textTertiary, other.textTertiary, t)!,
|
|
|
|
disabled: Color.lerp(disabled, other.disabled, t)!,
|
|
|
|
border: Color.lerp(border, other.border, t)!,
|
|
|
|
chartPink: Color.lerp(chartPink, other.chartPink, t)!,
|
|
|
|
chartOrange: Color.lerp(chartOrange, other.chartOrange, t)!,
|
|
|
|
chartBlue: Color.lerp(chartBlue, other.chartBlue, t)!,
|
|
|
|
chartGreen: Color.lerp(chartGreen, other.chartGreen, t)!,
|
|
|
|
chartPurple: Color.lerp(chartPurple, other.chartPurple, t)!,
|
|
|
|
chartMagenta: Color.lerp(chartMagenta, other.chartMagenta, t)!,
|
|
|
|
vipText: Color.lerp(vipText, other.vipText, t)!,
|
|
|
|
vipGold: Color.lerp(vipGold, other.vipGold, t)!,
|
|
|
|
vipPurple: Color.lerp(vipPurple, other.vipPurple, t)!,
|
|
|
|
backgroundLight: Color.lerp(backgroundLight, other.backgroundLight, t)!,
|
|
|
|
brandBackgroundLight: Color.lerp(brandBackgroundLight, other.brandBackgroundLight, t)!,
|
|
|
|
brandBackgroundGradient: LinearGradient.lerp(brandBackgroundGradient, other.brandBackgroundGradient, t)!,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|