8739fc0e26
Introduces candy-gloss tile rendering (diagonal gradient + glass highlight + optional glow) via a shared paintGlossyTile() in tile_painter.dart, applied to board filled-cells and tray/drag-overlay pieces. Adds ThemeColors to palette.dart for UI-layer season color resolution, and activeThemeProvider for one-call access to the active season's theme. Regenerates the game_screen golden to reflect the new look.
52 lines
1.6 KiB
Dart
52 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../game/models/season.dart';
|
|
|
|
/// Season-themeable color set. Season 1 default: vivid candy tones on a
|
|
/// deep navy board.
|
|
class GamePalette {
|
|
static const boardBackground = Color(0xFF151A2E);
|
|
static const emptyCell = Color(0xFF222A45);
|
|
static const boardBorder = Color(0xFF2E3858);
|
|
|
|
static const tileColors = <Color>[
|
|
Color(0xFF5B7FFF), // blue
|
|
Color(0xFFFF6B6B), // red
|
|
Color(0xFFFFC94D), // yellow
|
|
Color(0xFF4DD599), // green
|
|
Color(0xFFB980FF), // purple
|
|
Color(0xFFFF8FAB), // pink
|
|
Color(0xFF4DC9E6), // cyan
|
|
Color(0xFFFF9A5B), // orange
|
|
];
|
|
|
|
static Color tile(int colorId) => tileColors[colorId % tileColors.length];
|
|
|
|
static const gem = Color(0xFF7CF5FF);
|
|
static const ghostLegal = Color(0x66FFFFFF);
|
|
static const ghostIllegal = Color(0x55FF5252);
|
|
}
|
|
|
|
/// Resolved per-season colors for the UI layer. Built from a SeasonTheme;
|
|
/// falls back to the GamePalette constants.
|
|
class ThemeColors {
|
|
ThemeColors(SeasonTheme theme)
|
|
: gradient = [for (final c in theme.backgroundGradient) Color(c)],
|
|
accent = Color(theme.accentColor),
|
|
particleType = theme.particleType,
|
|
board = theme.boardTint != null
|
|
? Color(theme.boardTint!)
|
|
: GamePalette.boardBackground,
|
|
tiles = theme.tilePalette != null
|
|
? [for (final c in theme.tilePalette!) Color(c)]
|
|
: GamePalette.tileColors;
|
|
|
|
final List<Color> gradient;
|
|
final Color accent;
|
|
final String particleType;
|
|
final Color board;
|
|
final List<Color> tiles;
|
|
|
|
Color tile(int colorId) => tiles[colorId % tiles.length];
|
|
}
|