Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-04-29 12:47:14 +08:00
parent c7864ff4a3
commit cd26cf6d98
104 changed files with 482 additions and 391 deletions

View File

@@ -0,0 +1,17 @@
import 'package:flutter/rendering.dart' show Color;
abstract final class ColourUtils {
static Color parseColor(String color) =>
Color(int.parse('FF${color.substring(1)}', radix: 16));
static Color parseMedalColor(String color) => Color(
int.parse('${color.substring(7)}${color.substring(1, 7)}', radix: 16),
);
static Color index2Color(int index, Color color) => switch (index) {
0 => const Color(0xFFfdad13),
1 => const Color(0xFF8aace1),
2 => const Color(0xFFdfa777),
_ => color,
};
}