PdfColorHsv.fromRgb constructor
Creates an HSV color from red, green, blue components
Implementation
factory PdfColorHsv.fromRgb(double red, double green, double blue,
[double alpha = 1.0]) {
final max = math.max(red, math.max(green, blue));
final min = math.min(red, math.min(green, blue));
final delta = max - min;
final hue = _getHue(red, green, blue, max, delta);
final saturation = max == 0.0 ? 0.0 : delta / max;
return PdfColorHsv._(hue, saturation, max, red, green, blue, alpha);
}