libcolorpicker
libcolorpicker copied to clipboard
When i make my fallback Colour this it doesn't set the Colour to 0% alpha in my tweak preferences instead it sets it to 100% alpha
when i make my fallback Colour this it doesn't set the Colour to 0% alpha in my tweak preferences instead it sets it to 100% alpha
Did you ever find a fix for this? I need to make the alpha 0.44, but I can't figure out how to.
The reason is the alpha of fallback UIColor returned by colorFromHex
is fixed at 1
https://github.com/atomikpanda/libcolorpicker/blob/3ff8e63e773fa251a4b4bc2b6cbf560661137209/libcolorpicker.mm#L125-L128
A workaround is to manually set default value like this
NSString *colorString = prefs?(prefs[@"bgColor"]?:@"#0027FF:0.2"):@"#0027FF:0.2";
UIColor *bgColor = LCPParseColorString(colorString, nil);