如何创建动态图标(取决于浏览器颜色)?

How to create a dynamic favicon (which is depending on the browser color)?

我在我的网站上添加了一个图标,但是图标是黑色的,例如在 Mozilla FF 深色模式下无法看到。我如何(使用 JS 或 HTML)检测浏览器颜色?

无法获取浏览器的颜色。唯一的可能性是检测浏览器是否处于黑暗模式。

该案例的解决方案显示在 Is it possible to use a different favicon for browsers that support theme-color? and 下,但无法获取浏览器选项卡的颜色。