We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 04bb786 commit acb7df5Copy full SHA for acb7df5
1 file changed
lib/src/utils.dart
@@ -56,9 +56,9 @@ class ColorUtils {
56
final sg = bbcodeColor.g;
57
final sb = bbcodeColor.b;
58
final sa = bbcodeColor.a;
59
- final r = ((sr * sa + 0 * (1 - sa)) * 255).toInt().toRadixString(16);
60
- final g = ((sg * sa + 0 * (1 - sa)) * 255).toInt().toRadixString(16);
61
- final b = ((sb * sa + 0 * (1 - sa)) * 255).toInt().toRadixString(16);
+ final r = ((sr * sa + 0 * (1 - sa)) * 255).toInt().toRadixString(16).padLeft(2, '0');
+ final g = ((sg * sa + 0 * (1 - sa)) * 255).toInt().toRadixString(16).padLeft(2, '0');
+ final b = ((sb * sa + 0 * (1 - sa)) * 255).toInt().toRadixString(16).padLeft(2, '0');
62
return '#$r$g$b';
63
} else {
64
return 'rgb(${(bbcodeColor.r * 255).toInt()}, '
0 commit comments