shade method
Build a Material Color shade using the given strength
.
To lighten a color, set the strength
value to < .5
To darken a color, set the strength
value to > .5
Implementation
PdfColor shade(double strength) {
final ds = 1.5 - strength;
final hsl = toHsl();
return PdfColorHsl(
hsl.hue, hsl.saturation, (hsl.lightness * ds).clamp(0.0, 1.0));
}