getHct method

Hct getHct(
  1. double tone
)

Returns the HCT color at the given tone.

If the palette is constructed from a list of colors (i.e. using fromList), the color provided at construction is returned if possible; otherwise the result is generated from the deduced hue and chroma.

If the palette is constructed from a hue and chroma (i.e. using of or fromHct), the result is generated from the given hue and chroma.

Implementation

Hct getHct(double tone) {
  if (_cache.containsKey(tone)) {
    return Hct.fromInt(_cache[tone]!);
  } else {
    return Hct.from(hue, chroma, tone);
  }
}