EddyVerbruggen / cordova-plugin-webviewcolor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Transparent background color

abardik opened this issue · comments

Is it possible to set a transparent background color with this plugin, like #aarrggbb (phonegap's BackgroundColor preference format) or rgba(rr, gg, bb, aa)?

Nope, not at the moment, but I guess changing that alpha in this line would make it possible:

return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 green:((rgbValue & 0xFF00) >> 8)/255.0 blue:(rgbValue & 0xFF)/255.0 alpha:1.0];

Thank you, I'll try it.

Cool!

Perhaps it's best to make a copy of that native function and the JS function - something like changeWithAlpha so we don't affect current users. I'd merge a PR :)

Or we can accept both formats in one function. If the value is #FF112233, we'll use alpha channel. If the value is #112233 (existing projects), we'll use a regular RGB. And readme should be changed.

That would be perfect!

Available on npm now (version 2.1.0) - thanks for this cool feature!

Thanks for this and a lot of other cool plugins! I personally use background-mode, customurlscheme, insomnia, node-jwt, local-notifications and push. Thank you!