elk-zone / elk

A nimble Mastodon web client
https://elk.zone
MIT License
5.41k stars 557 forks source link

role badge color unreadible #2775

Open wakest opened 6 months ago

wakest commented 6 months ago

on Elk the role badge text is showing up almost unreadable when 'color' is set to black in mastodon's admin settings

image

heres what it looks like on Mastodon

image

this is set in mastodon's admin page at instance.tld/admin/roles/

image

the role badge looks quite good when the color is set to something that works with the theme:

image
stackblitz[bot] commented 6 months ago

Solve in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

shuuji3 commented 5 months ago

I can confirm this issue. Mastodon can specify arbitrary colors. So maybe Elk needs to use the fixed color (like the theme color) instead of the given custom color like Mastodon UI.

image

image

There might be a way to choose a good color dynamically from the specified color. For example, choose a color that has enough contrast to both the custom color and the color mode (dark/light)? But I don't have any idea to do so for now.

shuuji3 commented 5 months ago

Leonardo: an open source contrast-based color generator | by Nate Baldwin | Medium - https://medium.com/@NateBaldwin/leonardo-an-open-source-contrast-based-color-generator-92d61b6521d2

This might be a potential solution but I think it's too complicated just for the badge color.