-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Themed/colored icons for web apps #1091
Comments
"monochrome" was designed to handle this scenario by itself. "maskable" isn't needed at all. We just need Google WebAPK to add support. For example, Figure 11 in the spec could represent a user themed icon where a gray background and yellow foreground is selected. The operating system can apply any cropping necessary. Example implementation is available for Android Bubblewrap: GoogleChromeLabs/bubblewrap#650 |
How are safe zone and cropping/masking of such icons handled? Will the operating system also apply additional padding to prevent parts of the icon from being cropped? Won't that mean that the size of the actual icon content may be different depending on the mask/style that the operating system uses (and whether themed icons are enabled)? For normal maskable icons, that padding is added by the icon, so the size always appears the same. But for themed icons, I think this might not be the case. For example, if a monochrome icon was the shape of a square and the operating system also used perfectly square icons, no cropping and padding would be needed, so the provided icon would be the full size of a displayed application icon. However, if the operating system displayed circle icons, it would need to add additional padding around the original icon before masking it to the circle, to prevent parts of the icon from being cropped. This would cause the provided icon to be smaller i.e. represent a smaller portion of the whole application icon. I hope it's clear what I'm asking. But maybe I'm not correctly understanding how themed icons work... |
@NotWoods is correct. This is precisely what Note that I don't think these have been implemented by any user agent for main app icons (they are used, e.g. on Android for shortcut icons). That means there's an opportunity for browsers to implement this spec for main app icons when exposed to an environment like Android Themed Icons. It also means sites need to start adding I take your point @filips123 that there is no way to specify a combination of "maskable" and "monochrome" at the same time. However, I don't think that's required here. The reason why In the case of Based on the above explanation, I'm going to close this (already implemented). Feel free to reopen or continue discussing if you think there is some aspect of Android Themed Icons that is not covered by |
Android 12/13 has introduced a new kind of icons, called themed icons, that change their colors depending on the wallpaper's main color:
This somewhat extends maskable that are already supported in web app manifests and implemented in most Android browsers. However, it appears that such fully-themed icons are currently not supported for web apps (or at least not documented anywhere I could find). I propose that this feature should be added, but there are some things that need to be cleared on how exactly this should be implemented.
Themed icons appear to be like a combination of "maskable" and "monochrome" icons, already supported by the web app manifest. Because of this, it might seem like an easy solution to let browsers use any icon that has both "maskable" and "monochrome" purposes specified as a themed icon. However, there is currently no way of specifying that a specific icon can only be used for both of those purposes together:
This means that, if a web app specifies an icon with both purposes, the browser could also incorrectly (in terms of UX, but correctly according to the specification) use that icon as a normal maskable icon (which would cause a monochrome icon to be displayed where a colored one should be), or as a normal monochrome icon (which would cause it to be displayed without any mask).
So, to solve this problem, there seem to be two solutions. One is to create another icon purpose (for example, "themed"), used only for such themed/colored icons. Another is to add a new syntax to the "purpose" field of the manifest which would allow specifying that both icon contexts must be satisfied in order to use that icon. For example, "maskable-monochrome", which the browser would then interpret and install as a themed/colored icon.
The text was updated successfully, but these errors were encountered: