follmann / favicon_maker

Create favicon files in various sizes from a base image for ruby projects
MIT License
70 stars 7 forks source link

Alpha #17

Closed leighmcculloch closed 6 years ago

leighmcculloch commented 9 years ago

Some favicon formats should not have transparency, while others should. It would be really useful to be able to specify for a specific icon config not only the size but if alpha should be replaced with a colour and the hex for that colour.

I may take a stab at doing this sometime soon and opening a PR, but wanted to open conversation about this now in-case @follmann there's actually a way to already do this with the options that get passed in and through the gem.

Use case: Most modern desktop browsers display partially transparent favicons really well, and they look good. Apple touch icons on the other hand will have any alpha replaced with black by Safari when creating the home screen icon, which may not be the desired effect.

follmann commented 9 years ago

Hi, I never noticed that behaviour of Safari myself. And I'm pretty sure, that wasn't always the case. Do you have 'precomposed' in your icons filenames that have the alpha issue?

Right now, it's not possible to pass in any other options besides :size and :format. If you wanna take a stab at it, you would wanna look into creator.rb to get going, specifically here: https://github.com/follmann/favicon_maker/blob/master/lib/favicon_maker/creator.rb#L29