mirror of
https://github.com/pd4d10/git-touch.git
synced 2026-03-12 02:06:17 -05:00
fix: avoid hex color parse error
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user