secondaryLightRef property

Color? secondaryLightRef
final

A reference to the secondary color used in a light theme mode FlexSchemeColor.

This color typically only needs to be provided in a FlexSchemeColor used for dark mode colors. The secondaryLightRef color value should be the same color as the secondary color in the light mode FlexSchemeColor. If you intend to use the toDark to compute dark mode colors from a light mode FlexSchemeColor, you should also define the secondaryLightRef color in order to keep the fixed colors identical in light and dark mode, when using the toDark method.

In dark mode color schemes this reference color is used so that SeedColorScheme.fromSeeds can compute the same colors in dark mode, as in light mode, for the ColorScheme colors ColorScheme.primaryFixed, ColorScheme.onPrimaryFixed, ColorScheme.primaryFixedDim and ColorScheme.onPrimaryFixedVariant.

This color does not need to be provided in a FlexSchemeColor used for light mode colors, as it is not used in light mode.

If this color is not provided in a dark mode FlexSchemeColor, the fixed and fixedDim colors will be computed from the secondary color. Typically this secondary is not the same color as in light mode, so the fixed dark colors will then not match the fixed light mode colors. The design intent of the fixed colors is that they should be identical in light and dark mode. If you want this, you must provide the same color as in the light mode FlexSchemeColor.secondary for this color.

Implementation

final Color? secondaryLightRef;