heatColor function

int heatColor(
  1. double t
)

Implementation

int heatColor(double t) {
  if (t <= 0.06) return 0;
  final idx = math.min(
    kFireRamp.length - 1,
    ((1.0 - math.min(1.0, t)) * (kFireRamp.length - 1)).floor(),
  );
  return kFireRamp[idx];
}