Closed ryanbinnsrv closed 5 months ago
Can you explain a bit more what you mean? (Meanwhile I'll try to answer based on how I understood the question.)
Just to show a box that picks ARGB color 0x00000000? Fully transparent? Then no that is not an option that is directly available.
You can show the opacity slider on the standard swatch color pickers, and not show the "any color" wheel color picker, but you can then of course create opaque colors of any of the swatch standard colors.
Using the "Custom" color picker tab you can create a tab with a custom label that contains any colors you want, so you could add all the standard material swatches (there are premade list of them in the Flutter SDK and also in FlexColorPicker that make this easy), then also add a custom MaterialColor
where all color values are 0x00000000, if that is what you are looking for.
https://pub.dev/packages/flex_color_picker#custom-color-swatches
Yes, your first understanding was correct. I want a fully transparent color swatch to choose from. I tried using the custom color picker tab, but unless I enable the opacity, it forces the opacity to be fully opaque, so I just get black as the return value. If I enable the opacity, I get the slider, which I don't want.
Indeed you are right, it will remove transparency from custom colors too when opacity slider is not enabled, on purpose. I can certainly modify that behavior for custom colors and also maybe add an option to show a transparent color selection, reasonably easy to add.
Support for transparent custom colors coming in version 3.4.0. They work also even if opacity control is not enabled. If transparency exist in any custom colors they are just respected as given.
This feature was much tricker than I thought it would be to get it to work properly. Which also triggered that I need to refactor the picker code to make it more structured before I start tackling version 4.0.0. This package was one of the first things I made with Flutter, so it is a bit rough around the edges and I never bothered to clean it up. If it ain't broke don't fix it right? Well, I will need to "fix-it" to tackle all the features I have planned for version 4.0.0 anyway. Almost started doing it to make this work, but managed to get what I think is decent behavior out of it without it.
New feature for this added in just released version 3.4.0 https://pub.dev/packages/flex_color_picker/changelog.
Closing this as resolved.
Is there any way to allow
transparent
as a color option, without showing the opacity slider? I want to the user to be able to pick from the standard color swatches plus transparent. I don't want them to be able to set the opacity of any of the other colors.