Add util for getting text color based on background
This commit is contained in:
parent
4bc6164b64
commit
b13508c011
|
@ -0,0 +1,9 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
Color textColorBasedOnBackground(Color color) {
|
||||
if (color.computeLuminance() > 0.5) {
|
||||
return Colors.black;
|
||||
} else {
|
||||
return Colors.white;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue