setAlpha and setOpacity have no effect
Summary
The setAlpha and setOpacity methods don't seem to have any effect on the TinyColor instance.
Possible cause
Looking at the source, I believe this is because these methods are defined like this:
TinyColor setAlpha(int alpha) {
_color.withAlpha(alpha);
return this;
}
However, the withAlpha method returns a new Color instance:
Returns a new color that matches this color with the alpha channel replaced with a (which ranges from 0 to 255).
so this doesn't actually change _color.
I just encounter the same issue. For workaround, do .color.withOpacity() or .color.withAlpha().…
Hey @nfriend, can you resubmit this issue to community-forked repo? Thanks!
@calvintam236 Done! https://github.com/FooStudio/tinycolor/issues/14