pin_code_fields
pin_code_fields copied to clipboard
A color with a non-1.0 opacity appears differently for a fill color vs color
Consider a PinCodeTextField with a color which has an opacity value of 1.0:
final inactiveColor = Colors.red;
return PinCodeTextField(
controller: controller,
appContext: context,
length: 4,
autoFocus: true,
enableActiveFill: true,
pinTheme: PinTheme(
shape: PinCodeFieldShape.box,
fieldHeight: 48,
fieldWidth: 32,
inactiveColor: inactiveColor,
inactiveFillColor: inactiveColor,
),
);
This will appear as:
However, if you change the opacity on inactiveColor to contain a non-1.0 opacity:
final inactiveColor = Colors.red.withOpacity(0.5);
This will appear as:
The expected behavior, I believe, would be here that since inactiveColor and inactiveFillColor are both the exact same color value, the border and fill color should appear identical. However, it seems like some manipulation is done when the opacity is a value besides 1.0