mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-03 12:28:03 +08:00
Move files to src and comply with the dart package layout convention (#621)
* 👌 Use `Offset` type directly in `JoystickAction.update` calculations (#631) * Move files to src and comply with the dart package layout convention * Fixing widgets example Co-authored-by: Serge Matveenko <lig@countzero.co> Co-authored-by: Erick Zanardo <erickzanardoo@gmail.com>
This commit is contained in:
@ -1,30 +1 @@
|
||||
import 'dart:ui';
|
||||
|
||||
class PaletteEntry {
|
||||
final Color color;
|
||||
|
||||
Paint get paint => Paint()..color = color;
|
||||
|
||||
const PaletteEntry(this.color);
|
||||
|
||||
PaletteEntry withAlpha(int alpha) {
|
||||
return PaletteEntry(color.withAlpha(alpha));
|
||||
}
|
||||
|
||||
PaletteEntry withRed(int red) {
|
||||
return PaletteEntry(color.withRed(red));
|
||||
}
|
||||
|
||||
PaletteEntry withGreen(int green) {
|
||||
return PaletteEntry(color.withGreen(green));
|
||||
}
|
||||
|
||||
PaletteEntry withBlue(int blue) {
|
||||
return PaletteEntry(color.withBlue(blue));
|
||||
}
|
||||
}
|
||||
|
||||
class BasicPalette {
|
||||
static const PaletteEntry white = PaletteEntry(Color(0xFFFFFFFF));
|
||||
static const PaletteEntry black = PaletteEntry(Color(0xFF000000));
|
||||
}
|
||||
export 'src/palette.dart';
|
||||
|
||||
Reference in New Issue
Block a user