hctHue method Null safety

int hctHue(
  1. int from,
  2. int to,
  3. double amount
)

Blends hue from one color into another. The chroma and tone of the original color are maintained.

from ARGB representation of color to ARGB representation of color amount how much blending to perform; 0.0 >= and <= 1.0 Returns from, with a hue blended towards to. Chroma and tone are constant.

Implementation

static int hctHue(int from, int to, double amount) {
  final ucs = cam16Ucs(from, to, amount);
  final ucsCam = Cam16.fromInt(ucs);
  final fromCam = Cam16.fromInt(from);
  final blended = Hct.from(
    ucsCam.hue,
    fromCam.chroma,
    ColorUtils.lstarFromArgb(from),
  );
  return blended.toInt();
}