Attempt to fix hover color to a more reasonable color for a dark theme
This commit is contained in:
parent
9201d9f214
commit
4082e126b6
4 changed files with 16 additions and 6 deletions
|
@ -7,14 +7,17 @@ import 'package:flutter/material.dart';
|
|||
class Utilities {
|
||||
static const Color BLACK = Color.fromARGB(255, 0, 0, 0);
|
||||
static const Color WHITE = Color.fromARGB(255, 255, 255, 255);
|
||||
static const Color GREY = Color.fromARGB(255, 80, 80, 80);
|
||||
|
||||
static String toRGBA(Color color) {
|
||||
return 'rgba(${color.r},${color.g},${color.b},${color.a / 255})';
|
||||
}
|
||||
|
||||
static Color textColor(Color color) {
|
||||
if (color.computeLuminance() > 0.6) {
|
||||
if (color.computeLuminance() > 0.75) {
|
||||
return BLACK;
|
||||
} else if (color.computeLuminance() > 0.25) {
|
||||
return GREY;
|
||||
} else {
|
||||
return WHITE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue