mirror of
https://github.com/pd4d10/git-touch.git
synced 2026-04-28 18:39:26 -05:00
fix: label color
This commit is contained in:
@@ -28,6 +28,14 @@ Color convertColor(String cssHex) {
|
||||
return Color(int.parse('ff' + cssHex, radix: 16));
|
||||
}
|
||||
|
||||
Color getFontColorByBrightness(Color color) {
|
||||
var grayscale = color.red * 0.3 + color.green * 0.59 + color.blue * 0.11;
|
||||
// print('color: $color, $grayscale');
|
||||
|
||||
var showWhite = grayscale < 128;
|
||||
return showWhite ? Colors.white : Colors.black;
|
||||
}
|
||||
|
||||
void nextTick(Function callback, [int milliseconds = 0]) {
|
||||
// FIXME:
|
||||
Future.delayed(Duration(milliseconds: 0)).then((_) {
|
||||
|
||||
Reference in New Issue
Block a user