lerp method

  1. @override
CustomColors lerp(
  1. covariant ThemeExtension<CustomColors>? other,
  2. double t
)
override

Linearly interpolate with another ThemeExtension object.

The t argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning a (or something equivalent to a), 1.0 meaning that the interpolation has finished, returning b (or something equivalent to b), and values in between meaning that the interpolation is at the relevant point on the timeline between a and b. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid (and can easily be generated by curves such as Curves.elasticInOut).

Values for t are usually obtained from an Animation<double>, such as an AnimationController.

Implementation

@override
CustomColors lerp(ThemeExtension<CustomColors>? other, double t) {
  if (other is! CustomColors) {
    return this;
  }
  return CustomColors(
    sourceTextprimary:
        Color.lerp(sourceTextprimary, other.sourceTextprimary, t),
    textprimary: Color.lerp(textprimary, other.textprimary, t),
    onTextprimary: Color.lerp(onTextprimary, other.onTextprimary, t),
    textprimaryContainer:
        Color.lerp(textprimaryContainer, other.textprimaryContainer, t),
    onTextprimaryContainer:
        Color.lerp(onTextprimaryContainer, other.onTextprimaryContainer, t),
    sourceTextsecondary:
        Color.lerp(sourceTextsecondary, other.sourceTextsecondary, t),
    textsecondary: Color.lerp(textsecondary, other.textsecondary, t),
    onTextsecondary: Color.lerp(onTextsecondary, other.onTextsecondary, t),
    textsecondaryContainer:
        Color.lerp(textsecondaryContainer, other.textsecondaryContainer, t),
    onTextsecondaryContainer: Color.lerp(
        onTextsecondaryContainer, other.onTextsecondaryContainer, t),
    sourceTextdisabled:
        Color.lerp(sourceTextdisabled, other.sourceTextdisabled, t),
    textdisabled: Color.lerp(textdisabled, other.textdisabled, t),
    onTextdisabled: Color.lerp(onTextdisabled, other.onTextdisabled, t),
    textdisabledContainer:
        Color.lerp(textdisabledContainer, other.textdisabledContainer, t),
    onTextdisabledContainer:
        Color.lerp(onTextdisabledContainer, other.onTextdisabledContainer, t),
    sourcePrimarymain:
        Color.lerp(sourcePrimarymain, other.sourcePrimarymain, t),
    primarymain: Color.lerp(primarymain, other.primarymain, t),
    onPrimarymain: Color.lerp(onPrimarymain, other.onPrimarymain, t),
    primarymainContainer:
        Color.lerp(primarymainContainer, other.primarymainContainer, t),
    onPrimarymainContainer:
        Color.lerp(onPrimarymainContainer, other.onPrimarymainContainer, t),
    sourcePrimarydark:
        Color.lerp(sourcePrimarydark, other.sourcePrimarydark, t),
    primarydark: Color.lerp(primarydark, other.primarydark, t),
    onPrimarydark: Color.lerp(onPrimarydark, other.onPrimarydark, t),
    primarydarkContainer:
        Color.lerp(primarydarkContainer, other.primarydarkContainer, t),
    onPrimarydarkContainer:
        Color.lerp(onPrimarydarkContainer, other.onPrimarydarkContainer, t),
    sourcePrimarylight:
        Color.lerp(sourcePrimarylight, other.sourcePrimarylight, t),
    primarylight: Color.lerp(primarylight, other.primarylight, t),
    onPrimarylight: Color.lerp(onPrimarylight, other.onPrimarylight, t),
    primarylightContainer:
        Color.lerp(primarylightContainer, other.primarylightContainer, t),
    onPrimarylightContainer:
        Color.lerp(onPrimarylightContainer, other.onPrimarylightContainer, t),
    sourcePrimarycontrast:
        Color.lerp(sourcePrimarycontrast, other.sourcePrimarycontrast, t),
    primarycontrast: Color.lerp(primarycontrast, other.primarycontrast, t),
    onPrimarycontrast:
        Color.lerp(onPrimarycontrast, other.onPrimarycontrast, t),
    primarycontrastContainer: Color.lerp(
        primarycontrastContainer, other.primarycontrastContainer, t),
    onPrimarycontrastContainer: Color.lerp(
        onPrimarycontrastContainer, other.onPrimarycontrastContainer, t),
    sourcePrimaryhover:
        Color.lerp(sourcePrimaryhover, other.sourcePrimaryhover, t),
    primaryhover: Color.lerp(primaryhover, other.primaryhover, t),
    onPrimaryhover: Color.lerp(onPrimaryhover, other.onPrimaryhover, t),
    primaryhoverContainer:
        Color.lerp(primaryhoverContainer, other.primaryhoverContainer, t),
    onPrimaryhoverContainer:
        Color.lerp(onPrimaryhoverContainer, other.onPrimaryhoverContainer, t),
    sourcePrimaryselected:
        Color.lerp(sourcePrimaryselected, other.sourcePrimaryselected, t),
    primaryselected: Color.lerp(primaryselected, other.primaryselected, t),
    onPrimaryselected:
        Color.lerp(onPrimaryselected, other.onPrimaryselected, t),
    primaryselectedContainer: Color.lerp(
        primaryselectedContainer, other.primaryselectedContainer, t),
    onPrimaryselectedContainer: Color.lerp(
        onPrimaryselectedContainer, other.onPrimaryselectedContainer, t),
    sourcePrimaryfocus:
        Color.lerp(sourcePrimaryfocus, other.sourcePrimaryfocus, t),
    primaryfocus: Color.lerp(primaryfocus, other.primaryfocus, t),
    onPrimaryfocus: Color.lerp(onPrimaryfocus, other.onPrimaryfocus, t),
    primaryfocusContainer:
        Color.lerp(primaryfocusContainer, other.primaryfocusContainer, t),
    onPrimaryfocusContainer:
        Color.lerp(onPrimaryfocusContainer, other.onPrimaryfocusContainer, t),
    sourcePrimaryoutlinedborder: Color.lerp(
        sourcePrimaryoutlinedborder, other.sourcePrimaryoutlinedborder, t),
    primaryoutlinedborder:
        Color.lerp(primaryoutlinedborder, other.primaryoutlinedborder, t),
    onPrimaryoutlinedborder:
        Color.lerp(onPrimaryoutlinedborder, other.onPrimaryoutlinedborder, t),
    primaryoutlinedborderContainer: Color.lerp(primaryoutlinedborderContainer,
        other.primaryoutlinedborderContainer, t),
    onPrimaryoutlinedborderContainer: Color.lerp(
        onPrimaryoutlinedborderContainer,
        other.onPrimaryoutlinedborderContainer,
        t),
    sourceSecondarymain:
        Color.lerp(sourceSecondarymain, other.sourceSecondarymain, t),
    secondarymain: Color.lerp(secondarymain, other.secondarymain, t),
    onSecondarymain: Color.lerp(onSecondarymain, other.onSecondarymain, t),
    secondarymainContainer:
        Color.lerp(secondarymainContainer, other.secondarymainContainer, t),
    onSecondarymainContainer: Color.lerp(
        onSecondarymainContainer, other.onSecondarymainContainer, t),
    sourceSecondarydark:
        Color.lerp(sourceSecondarydark, other.sourceSecondarydark, t),
    secondarydark: Color.lerp(secondarydark, other.secondarydark, t),
    onSecondarydark: Color.lerp(onSecondarydark, other.onSecondarydark, t),
    secondarydarkContainer:
        Color.lerp(secondarydarkContainer, other.secondarydarkContainer, t),
    onSecondarydarkContainer: Color.lerp(
        onSecondarydarkContainer, other.onSecondarydarkContainer, t),
    sourceSecondarylight:
        Color.lerp(sourceSecondarylight, other.sourceSecondarylight, t),
    secondarylight: Color.lerp(secondarylight, other.secondarylight, t),
    onSecondarylight: Color.lerp(onSecondarylight, other.onSecondarylight, t),
    secondarylightContainer:
        Color.lerp(secondarylightContainer, other.secondarylightContainer, t),
    onSecondarylightContainer: Color.lerp(
        onSecondarylightContainer, other.onSecondarylightContainer, t),
    sourceErrormain: Color.lerp(sourceErrormain, other.sourceErrormain, t),
    errormain: Color.lerp(errormain, other.errormain, t),
    onErrormain: Color.lerp(onErrormain, other.onErrormain, t),
    errormainContainer:
        Color.lerp(errormainContainer, other.errormainContainer, t),
    onErrormainContainer:
        Color.lerp(onErrormainContainer, other.onErrormainContainer, t),
    sourceErrordark: Color.lerp(sourceErrordark, other.sourceErrordark, t),
    errordark: Color.lerp(errordark, other.errordark, t),
    onErrordark: Color.lerp(onErrordark, other.onErrordark, t),
    errordarkContainer:
        Color.lerp(errordarkContainer, other.errordarkContainer, t),
    onErrordarkContainer:
        Color.lerp(onErrordarkContainer, other.onErrordarkContainer, t),
    sourceErrorlight: Color.lerp(sourceErrorlight, other.sourceErrorlight, t),
    errorlight: Color.lerp(errorlight, other.errorlight, t),
    onErrorlight: Color.lerp(onErrorlight, other.onErrorlight, t),
    errorlightContainer:
        Color.lerp(errorlightContainer, other.errorlightContainer, t),
    onErrorlightContainer:
        Color.lerp(onErrorlightContainer, other.onErrorlightContainer, t),
    sourceErrorconstant:
        Color.lerp(sourceErrorconstant, other.sourceErrorconstant, t),
    errorconstant: Color.lerp(errorconstant, other.errorconstant, t),
    onErrorconstant: Color.lerp(onErrorconstant, other.onErrorconstant, t),
    errorconstantContainer:
        Color.lerp(errorconstantContainer, other.errorconstantContainer, t),
    onErrorconstantContainer: Color.lerp(
        onErrorconstantContainer, other.onErrorconstantContainer, t),
    sourceWarningmain:
        Color.lerp(sourceWarningmain, other.sourceWarningmain, t),
    warningmain: Color.lerp(warningmain, other.warningmain, t),
    onWarningmain: Color.lerp(onWarningmain, other.onWarningmain, t),
    warningmainContainer:
        Color.lerp(warningmainContainer, other.warningmainContainer, t),
    onWarningmainContainer:
        Color.lerp(onWarningmainContainer, other.onWarningmainContainer, t),
    sourceWarningdark:
        Color.lerp(sourceWarningdark, other.sourceWarningdark, t),
    warningdark: Color.lerp(warningdark, other.warningdark, t),
    onWarningdark: Color.lerp(onWarningdark, other.onWarningdark, t),
    warningdarkContainer:
        Color.lerp(warningdarkContainer, other.warningdarkContainer, t),
    onWarningdarkContainer:
        Color.lerp(onWarningdarkContainer, other.onWarningdarkContainer, t),
    sourceWarninglight:
        Color.lerp(sourceWarninglight, other.sourceWarninglight, t),
    warninglight: Color.lerp(warninglight, other.warninglight, t),
    onWarninglight: Color.lerp(onWarninglight, other.onWarninglight, t),
    warninglightContainer:
        Color.lerp(warninglightContainer, other.warninglightContainer, t),
    onWarninglightContainer:
        Color.lerp(onWarninglightContainer, other.onWarninglightContainer, t),
    sourceInfomain: Color.lerp(sourceInfomain, other.sourceInfomain, t),
    infomain: Color.lerp(infomain, other.infomain, t),
    onInfomain: Color.lerp(onInfomain, other.onInfomain, t),
    infomainContainer:
        Color.lerp(infomainContainer, other.infomainContainer, t),
    onInfomainContainer:
        Color.lerp(onInfomainContainer, other.onInfomainContainer, t),
    sourceInfodark: Color.lerp(sourceInfodark, other.sourceInfodark, t),
    infodark: Color.lerp(infodark, other.infodark, t),
    onInfodark: Color.lerp(onInfodark, other.onInfodark, t),
    infodarkContainer:
        Color.lerp(infodarkContainer, other.infodarkContainer, t),
    onInfodarkContainer:
        Color.lerp(onInfodarkContainer, other.onInfodarkContainer, t),
    sourceInfolight: Color.lerp(sourceInfolight, other.sourceInfolight, t),
    infolight: Color.lerp(infolight, other.infolight, t),
    onInfolight: Color.lerp(onInfolight, other.onInfolight, t),
    infolightContainer:
        Color.lerp(infolightContainer, other.infolightContainer, t),
    onInfolightContainer:
        Color.lerp(onInfolightContainer, other.onInfolightContainer, t),
    sourceInfocontrast:
        Color.lerp(sourceInfocontrast, other.sourceInfocontrast, t),
    infocontrast: Color.lerp(infocontrast, other.infocontrast, t),
    onInfocontrast: Color.lerp(onInfocontrast, other.onInfocontrast, t),
    infocontrastContainer:
        Color.lerp(infocontrastContainer, other.infocontrastContainer, t),
    onInfocontrastContainer:
        Color.lerp(onInfocontrastContainer, other.onInfocontrastContainer, t),
    sourceSuccessmain:
        Color.lerp(sourceSuccessmain, other.sourceSuccessmain, t),
    successmain: Color.lerp(successmain, other.successmain, t),
    onSuccessmain: Color.lerp(onSuccessmain, other.onSuccessmain, t),
    successmainContainer:
        Color.lerp(successmainContainer, other.successmainContainer, t),
    onSuccessmainContainer:
        Color.lerp(onSuccessmainContainer, other.onSuccessmainContainer, t),
    sourceSuccessdark:
        Color.lerp(sourceSuccessdark, other.sourceSuccessdark, t),
    successdark: Color.lerp(successdark, other.successdark, t),
    onSuccessdark: Color.lerp(onSuccessdark, other.onSuccessdark, t),
    successdarkContainer:
        Color.lerp(successdarkContainer, other.successdarkContainer, t),
    onSuccessdarkContainer:
        Color.lerp(onSuccessdarkContainer, other.onSuccessdarkContainer, t),
    sourceSuccesslight:
        Color.lerp(sourceSuccesslight, other.sourceSuccesslight, t),
    successlight: Color.lerp(successlight, other.successlight, t),
    onSuccesslight: Color.lerp(onSuccesslight, other.onSuccesslight, t),
    successlightContainer:
        Color.lerp(successlightContainer, other.successlightContainer, t),
    onSuccesslightContainer:
        Color.lerp(onSuccesslightContainer, other.onSuccesslightContainer, t),
    sourceSuccesscontrast:
        Color.lerp(sourceSuccesscontrast, other.sourceSuccesscontrast, t),
    successcontrast: Color.lerp(successcontrast, other.successcontrast, t),
    onSuccesscontrast:
        Color.lerp(onSuccesscontrast, other.onSuccesscontrast, t),
    successcontrastContainer: Color.lerp(
        successcontrastContainer, other.successcontrastContainer, t),
    onSuccesscontrastContainer: Color.lerp(
        onSuccesscontrastContainer, other.onSuccesscontrastContainer, t),
    sourceBackgrounddefault:
        Color.lerp(sourceBackgrounddefault, other.sourceBackgrounddefault, t),
    backgrounddefault:
        Color.lerp(backgrounddefault, other.backgrounddefault, t),
    onBackgrounddefault:
        Color.lerp(onBackgrounddefault, other.onBackgrounddefault, t),
    backgrounddefaultContainer: Color.lerp(
        backgrounddefaultContainer, other.backgrounddefaultContainer, t),
    onBackgrounddefaultContainer: Color.lerp(
        onBackgrounddefaultContainer, other.onBackgrounddefaultContainer, t),
    sourceDivider: Color.lerp(sourceDivider, other.sourceDivider, t),
    divider: Color.lerp(divider, other.divider, t),
    onDivider: Color.lerp(onDivider, other.onDivider, t),
    dividerContainer: Color.lerp(dividerContainer, other.dividerContainer, t),
    onDividerContainer:
        Color.lerp(onDividerContainer, other.onDividerContainer, t),
    sourceCommonwhite:
        Color.lerp(sourceCommonwhite, other.sourceCommonwhite, t),
    commonwhite: Color.lerp(commonwhite, other.commonwhite, t),
    onCommonwhite: Color.lerp(onCommonwhite, other.onCommonwhite, t),
    commonwhiteContainer:
        Color.lerp(commonwhiteContainer, other.commonwhiteContainer, t),
    onCommonwhiteContainer:
        Color.lerp(onCommonwhiteContainer, other.onCommonwhiteContainer, t),
    sourceCommonblack:
        Color.lerp(sourceCommonblack, other.sourceCommonblack, t),
    surfaceContainerLowest:
        Color.lerp(surfaceContainerLowest, other.surfaceContainerLowest, t),
    surfaceContainerLow:
        Color.lerp(surfaceContainerLow, other.surfaceContainerLow, t),
    surfaceContainer: Color.lerp(surfaceContainer, other.surfaceContainer, t),
    surfaceContainerHigh:
        Color.lerp(surfaceContainerHigh, other.surfaceContainerHigh, t),
    surfaceContainerHieghest: Color.lerp(
        surfaceContainerHieghest, other.surfaceContainerHieghest, t),
  );
}