David PHAM-VAN

Fix PdfColors.shade()

@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 ## 1.7.0 3 ## 1.7.0
4 4
5 - Implement Linear and Radial gradients in BoxDecoration 5 - Implement Linear and Radial gradients in BoxDecoration
  6 +- Fix PdfColors.shade()
6 7
7 ## 1.6.2 8 ## 1.6.2
8 9
@@ -149,7 +149,8 @@ class PdfColor { @@ -149,7 +149,8 @@ class PdfColor {
149 final double ds = 1.5 - strength; 149 final double ds = 1.5 - strength;
150 final PdfColorHsl hsl = toHsl(); 150 final PdfColorHsl hsl = toHsl();
151 151
152 - return PdfColorHsl(hsl.hue, hsl.saturation, hsl.lightness * ds); 152 + return PdfColorHsl(
  153 + hsl.hue, hsl.saturation, (hsl.lightness * ds).clamp(0.0, 1.0));
153 } 154 }
154 155
155 /// Get a complementary color with hue shifted by -120° 156 /// Get a complementary color with hue shifted by -120°