Erin 'Folletto' Casali
unread,Aug 8, 2021, 4:23:04 AM8/8/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium Extensions, Jackie Han, Chromium Extensions, Erin 'Folletto' Casali
Hello Jackie,
To be clear I'm not asking on how to set the extension icon. That works, and I've already the code above that changes the color depending on the system-wide flag (light or dark) with `setIcon`.
I'm referring on how to detect the icon color and text color in the Chrome toolbar. When a light theme is loaded (default), the color of all the controls is dark-on-light. When a dark theme is loaded (custom theme, or user profile with a dark color) the color of all the controls is light-on-dark. While the default theme does this accordingly to `prefer-color-scheme`, a user can upload (or configure in the profile) a theme with a dark background, in which case Chrome reverses the colors for contrast regardless of the system-wide setting, so `prefer-color-scheme` can't be used in this situation to detect the color reversal.
I need a way to know when Chrome is reversing the color of the UI controls in the Chrome toolbar that doesn't use `prefer-color-scheme`.
Regards,
E·