Skip to content

Commit

Permalink
Merge pull request #13 from zhourengui/fix/black_being_parsed_as_tran…
Browse files Browse the repository at this point in the history
…sparent

Fixed black being parsed as transparent
  • Loading branch information
ggichure authored Apr 25, 2022
2 parents 8ec5086 + 97d8a44 commit be91152
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/hexcolor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ class HexColor extends Color {
if (hexColor.length == 6) {
hexColor = "FF" + hexColor;
}
return int.parse(hexColor, radix: 16);

final hexNum = int.parse(hexColor, radix: 16);

if (hexNum == 0) {
return 0xff000000;
}

return hexNum;
}

HexColor(final String hexColor) : super(_getColorFromHex(hexColor));
Expand Down

0 comments on commit be91152

Please sign in to comment.