1
0
mirror of https://github.com/flutter/samples.git synced 2026-03-25 05:41:41 +00:00
Files
samples/game_template/lib/src/style/palette.dart
Filip Hracek daa024a829 Add game_template (#1180)
Adds a template / sample for games built in Flutter, with all the bells and whistles, like ads, in-app purchases, audio, main menu, settings, and so on.

Co-authored-by: Parker Lougheed
Co-authored-by: Shams Zakhour
2022-05-10 15:08:43 +02:00

38 lines
1.6 KiB
Dart

// Copyright 2022, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
/// A palette of colors to be used in the game.
///
/// The reason we're not going with something like Material Design's
/// `Theme` is simply that this is simpler to work with and yet gives
/// us everything we need for a game.
///
/// Games generally have more radical color palettes than apps. For example,
/// every level of a game can have radically different colors.
/// At the same time, games rarely support dark mode.
///
/// Colors taken from this fun palette:
/// https://lospec.com/palette-list/crayola84
///
/// Colors here are implemented as getters so that hot reloading works.
/// In practice, we could just as easily implement the colors
/// as `static const`. But this way the palette is more malleable:
/// we could allow players to customize colors, for example,
/// or even get the colors from the network.
class Palette {
Color get pen => const Color(0xff1d75fb);
Color get darkPen => const Color(0xFF0050bc);
Color get redPen => const Color(0xFFd10841);
Color get inkFullOpacity => const Color(0xff352b42);
Color get ink => const Color(0xee352b42);
Color get backgroundMain => const Color(0xffffffd1);
Color get backgroundLevelSelection => const Color(0xffa2dcc7);
Color get backgroundPlaySession => const Color(0xffffebb5);
Color get background4 => const Color(0xffffd7ff);
Color get backgroundSettings => const Color(0xffbfc8e3);
Color get trueWhite => const Color(0xffffffff);
}