Handle default color

pull/13/head
singerdmx 4 years ago
parent 30d946d358
commit bf9332853a
  1. 5
      lib/widgets/text_line.dart

@ -123,6 +123,11 @@ class TextLine extends StatelessWidget {
int.parse(arr[2]), double.parse(arr[3]));
}
if (!s.startsWith('#')) {
// give a default color
return Colors.transparent;
}
String hex = s.replaceFirst('#', '');
hex = hex.length == 6 ? 'ff' + hex : hex;
int val = int.parse(hex, radix: 16);

Loading…
Cancel
Save