getPiecewiseValue static method
Implementation
static double getPiecewiseValue(
Hct sourceColorHct,
List<double> hueBreakpoints,
List<double> hues,
) {
final size = math.min(hueBreakpoints.length - 1, hues.length);
final sourceHue = sourceColorHct.hue;
for (var i = 0; i < size; i++) {
if (sourceHue >= hueBreakpoints[i] && sourceHue < hueBreakpoints[i + 1]) {
return MathUtils.sanitizeDegreesDouble(hues[i]);
}
}
// No condition matched, return the source value.
return sourceHue;
}