withOpacity method
Returns a new color that matches this color, but with its opacity modified.
By default, the current opacity is replaced with the given opacity value (which ranges from 0.0 to 1.0).
When replace
is false, the current opacity will be increased or decreased by the specified
amount (ranging from -1.0 to 1.0).
Implementation
@override
ThemeColor withOpacity(double opacity, {bool replace = true}) {
return ThemeColor(
light.withOpacity(opacity, replace: replace),
dark: dark?.withOpacity(opacity, replace: replace),
);
}