getHct method
Return a color, expressed in the HCT color space, that this
DynamicColor is under the conditions in scheme
.
scheme
Defines the conditions of the user interface, for example,
whether or not it is dark mode or light mode, and what the desired
contrast level is.
Implementation
Hct getHct(DynamicScheme scheme) {
final Hct? cachedAnswer = _hctCache[scheme];
if (cachedAnswer != null) {
return cachedAnswer;
}
final double tone = getTone(scheme);
final Hct answer = palette(scheme).getHct(tone);
if (_hctCache.length > 4) {
_hctCache.clear();
}
_hctCache[scheme] = answer;
return answer;
}