getHct method

Hct getHct(
  1. double tone
)

Get the HCT color for a given tone.

Implementation

Hct getHct(double tone) {
  if (_hue == null || _chroma == null) {
    if (!_cache.containsKey(tone)) {
      throw ArgumentError.value(
        tone,
        'tone',
        'When a TonalPalette is created with fromList, tone must be one of '
            '$commonTones',
      );
    } else {
      return Hct.fromInt(_cache[tone]!);
    }
  }
  return Hct.from(_hue!, _chroma!, tone);
}