mirror of
https://github.com/git-touch/git-touch
synced 2025-01-31 08:04:51 +01:00
fix: avoid hex color parse error
This commit is contained in:
parent
d9ca01b99d
commit
5f45a54f95
@ -48,7 +48,7 @@ Color convertColor(String cssHex) {
|
||||
if (cssHex.length == 3) {
|
||||
cssHex = cssHex.split('').map((char) => char + char).join('');
|
||||
}
|
||||
return Color(int.parse('ff' + cssHex, radix: 16));
|
||||
return Color(int.tryParse('ff' + cssHex, radix: 16) ?? 0);
|
||||
}
|
||||
|
||||
Color getFontColorByBrightness(Color color) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user