Categories page works!
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
enum CategoryColor {
|
||||
black("273036"),
|
||||
blue("00a9b3"),
|
||||
red("c71634"),
|
||||
darkred("ff2816"),
|
||||
lime("bfff55"),
|
||||
green("189749"),
|
||||
pink("ff65ae"),
|
||||
purple("5b3ab1"),
|
||||
cyan("005744"),
|
||||
orange("ff6d01"),
|
||||
yellow("fff336");
|
||||
|
||||
const CategoryColor(this.hex);
|
||||
|
||||
final String hex;
|
||||
|
||||
name() {
|
||||
return this.toString().split('.').last;
|
||||
}
|
||||
|
||||
backgroundColor() {
|
||||
return Color(int.parse("0xff$hex"));
|
||||
}
|
||||
|
||||
foregroundColor() {
|
||||
return Color(int.parse("0xff$hex")).computeLuminance() > 0.3
|
||||
? Colors.black
|
||||
: Colors.white;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user