feat: glossy tile rendering and per-season theme colors
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.
This commit is contained in:
@@ -6,6 +6,7 @@ import '../../game/models/piece.dart';
|
||||
import '../theme/palette.dart';
|
||||
import 'board_geometry.dart';
|
||||
import 'piece_painter.dart';
|
||||
import 'tile_painter.dart';
|
||||
|
||||
/// Drag ghost preview: a piece hovering at a snapped anchor.
|
||||
class GhostSpec {
|
||||
@@ -55,27 +56,20 @@ class BoardPainter extends CustomPainter {
|
||||
for (var x = 0; x < GridState.size; x++) {
|
||||
final rect = geo.cellRect(x, y).deflate(inset);
|
||||
final cell = grid.cellAt(x, y);
|
||||
final paint = Paint()
|
||||
..color = switch (cell.type) {
|
||||
CellType.empty => GamePalette.emptyCell,
|
||||
CellType.filled => GamePalette.tile(cell.colorId),
|
||||
CellType.gem => GamePalette.emptyCell,
|
||||
};
|
||||
canvas.drawRRect(RRect.fromRectAndRadius(rect, radius), paint);
|
||||
|
||||
if (cell.type == CellType.gem) {
|
||||
_paintGem(canvas, rect);
|
||||
} else if (cell.type == CellType.filled) {
|
||||
final highlight = Paint()
|
||||
..color = Colors.white.withValues(alpha: 0.15);
|
||||
canvas.drawRRect(
|
||||
RRect.fromRectAndRadius(
|
||||
Rect.fromLTWH(
|
||||
rect.left, rect.top, rect.width, rect.height * 0.32),
|
||||
radius,
|
||||
),
|
||||
highlight,
|
||||
);
|
||||
switch (cell.type) {
|
||||
case CellType.empty:
|
||||
canvas.drawRRect(
|
||||
RRect.fromRectAndRadius(rect, radius),
|
||||
Paint()..color = GamePalette.emptyCell,
|
||||
);
|
||||
case CellType.filled:
|
||||
paintGlossyTile(canvas, rect, GamePalette.tile(cell.colorId));
|
||||
case CellType.gem:
|
||||
canvas.drawRRect(
|
||||
RRect.fromRectAndRadius(rect, radius),
|
||||
Paint()..color = GamePalette.emptyCell,
|
||||
);
|
||||
_paintGem(canvas, rect);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,6 +105,10 @@ class BoardPainter extends CustomPainter {
|
||||
}
|
||||
|
||||
void _paintGem(Canvas canvas, Rect rect) {
|
||||
final glowPaint = Paint()
|
||||
..color = GamePalette.gem.withValues(alpha: 0.45)
|
||||
..maskFilter = MaskFilter.blur(BlurStyle.normal, rect.width * 0.25);
|
||||
canvas.drawCircle(rect.center, rect.width * 0.32, glowPaint);
|
||||
final center = rect.center;
|
||||
final r = rect.width * 0.32;
|
||||
final path = Path()
|
||||
|
||||
Reference in New Issue
Block a user