We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24bd197 commit c3a2d32Copy full SHA for c3a2d32
lib/src/css_parser.dart
@@ -844,14 +844,15 @@ class ExpressionMapping {
844
var text = _text.replaceFirst('#', '');
845
if (text.length == 3)
846
text = text.replaceAllMapped(
847
- RegExp(r"[a-f]|\d"), (match) => '${match.group(0)}${match.group(0)}');
848
- int color = int.parse(text, radix: 16);
849
-
850
- if (color <= 0xffffff) {
851
- return new Color(color).withAlpha(255);
+ RegExp(r"[a-f]|\d", caseSensitive: false),
+ (match) => '${match.group(0)}${match.group(0)}'
+ );
+ if (text.length > 6) {
+ text = "0x" + text;
852
} else {
853
- return new Color(color);
+ text = "0xFF" + text;
854
}
855
+ return new Color(int.parse(text));
856
857
858
static Color? rgbOrRgbaToColor(String text) {
0 commit comments