Showing
2 changed files
with
3 additions
and
1 deletions
@@ -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° |
-
Please register or login to post a comment