adar2378 / pin_code_fields

A flutter package which will help you to generate pin code fields with beautiful design and animations. Can be useful for OTP or pin code inputs 🤓🤓
https://pub.dev/packages/pin_code_fields
MIT License
677 stars 330 forks source link

A color with a non-1.0 opacity appears differently for a fill color vs color #375

Closed aamirki closed 1 month ago

aamirki commented 3 months ago

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: Screenshot 2024-04-08 at 5 03 06 PM

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: Screenshot 2024-04-08 at 5 03 36 PM

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

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.