hctHue static method

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 int ucs = cam16Ucs(from, to, amount);
  final Cam16 ucsCam = Cam16.fromInt(ucs);
  final Cam16 fromCam = Cam16.fromInt(from);
  final Hct blended = Hct.from(
    ucsCam.hue,
    fromCam.chroma,
    ColorUtils.lstarFromArgb(from),
  );
  return blended.toInt();
}