Files
BlockSeasons/lib/ui/theme/palette.dart
T
airkjw 2b44dcd812 fix: journey map season-complete styling, scroll callback guard, palette constant
- Guard addPostFrameCallback with !_autoScrolled so it only fires once per
  widget lifetime instead of on every LayoutBuilder rebuild.
- Derive seasonComplete flag; pass it into _node so the last stage uses
  gold "done" styling (not "current/next") when the season is fully 3-starred.
- Extract const Color(0xFF232B4A) to GamePalette.lockedNode.
- Remove warnIfMissed: false from tap call in season_map_screen_test; ensureVisible
  already guarantees hit-testing succeeds (confirmed: test still passes cleanly).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 23:30:22 +09:00

53 lines
1.7 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 lockedNode = Color(0xFF232B4A);
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];
}