lerp static method

Linearly interpolate between two themes.

Implementation

static SfChartThemeData? lerp(
    SfChartThemeData? a, SfChartThemeData? b, double t) {
  if (a == null && b == null) {
    return null;
  }
  return SfChartThemeData(
    axisLabelColor: Color.lerp(a!.axisLabelColor, b!.axisLabelColor, t),
    axisLineColor: Color.lerp(a.axisLineColor, b.axisLineColor, t),
    axisTitleColor: Color.lerp(a.axisTitleColor, b.axisTitleColor, t),
    backgroundColor: Color.lerp(a.backgroundColor, b.backgroundColor, t),
    titleTextColor: Color.lerp(a.titleTextColor, b.titleTextColor, t),
    crosshairBackgroundColor:
        Color.lerp(a.crosshairBackgroundColor, b.crosshairBackgroundColor, t),
    crosshairLabelColor:
        Color.lerp(a.crosshairLabelColor, b.crosshairLabelColor, t),
    crosshairLineColor:
        Color.lerp(a.crosshairLineColor, b.crosshairLineColor, t),
    legendBackgroundColor:
        Color.lerp(a.legendBackgroundColor, b.legendBackgroundColor, t),
    legendTextColor: Color.lerp(a.legendTextColor, b.legendTextColor, t),
    legendTitleColor: Color.lerp(a.legendTitleColor, b.legendTitleColor, t),
    majorGridLineColor:
        Color.lerp(a.majorGridLineColor, b.majorGridLineColor, t),
    majorTickLineColor:
        Color.lerp(a.majorTickLineColor, b.majorTickLineColor, t),
    minorGridLineColor:
        Color.lerp(a.minorGridLineColor, b.minorGridLineColor, t),
    minorTickLineColor:
        Color.lerp(a.minorTickLineColor, b.minorTickLineColor, t),
    plotAreaBackgroundColor:
        Color.lerp(a.plotAreaBackgroundColor, b.plotAreaBackgroundColor, t),
    plotAreaBorderColor:
        Color.lerp(a.plotAreaBorderColor, b.plotAreaBorderColor, t),
    selectionRectColor:
        Color.lerp(a.selectionRectColor, b.selectionRectColor, t),
    selectionRectBorderColor:
        Color.lerp(a.selectionRectBorderColor, b.selectionRectBorderColor, t),
    selectionTooltipConnectorLineColor: Color.lerp(
        a.selectionTooltipConnectorLineColor,
        b.selectionTooltipConnectorLineColor,
        t),
    titleBackgroundColor:
        Color.lerp(a.titleBackgroundColor, b.titleBackgroundColor, t),
    tooltipColor: Color.lerp(a.tooltipColor, b.tooltipColor, t),
    tooltipSeparatorColor:
        Color.lerp(a.tooltipSeparatorColor, b.tooltipSeparatorColor, t),
    tooltipLabelColor:
        Color.lerp(a.tooltipLabelColor, b.tooltipLabelColor, t),
    waterfallConnectorLineColor: Color.lerp(
        a.waterfallConnectorLineColor, b.waterfallConnectorLineColor, t),
  );
}