Skip to content
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

[Feature] Tag colors #3200

Open
xx790 opened this issue Nov 27, 2022 · 4 comments
Open

[Feature] Tag colors #3200

xx790 opened this issue Nov 27, 2022 · 4 comments

Comments

@xx790
Copy link

xx790 commented Nov 27, 2022

Is your feature request related to a problem? Please describe.

I have a lot of tags. Some tags fall under common categories. I'd like to make tags of the same nature to be more like each other and more distinguishable from other tags visually.

Describe the solution you'd like

Typical solution on booru sites: tags of certain kinds are distinguished by color.
stash doesn't have namespaced tags but it has tags graph that can potentially be used. Albeit multiple parents can make it complicated.

There are multiple ways this can be implemented:

  • Each tag has an extra field for background color. No inheritance, more manual work but I can live with it;
  • Common color for children tags is set in the parent tag (meta tag for my purposes). Not sure how to resolve conflicts;
  • Color can be inherited from parent tag(s). Same disadvantage as with the previous plus inability to have parent meta tags to be different from children;
  • Add semantic markup so I could solve coloring issue in CSS. Specifically, add a data property to tag cards that would list tag parents. Like data-parents="tag1 tag2". Very DIY, mentioning it here in case it is cheap to add.

Color range:
Hue slider might be preferable compared to full RGB range. It might be easier to ensure consistent looks and good contrast in both dark and light theme. (Relevant: HSL color model in CSS)

Sort by color:
Would be nice to have. First tags with specified colors, then the rest.

@echo6ix
Copy link
Contributor

echo6ix commented Nov 27, 2022

People are already doing this with userscripts, no?

I think a built-in feature like this should be considered with caution. To mitigate confusion and improve consistency throughout the UI I think the UI needs to adhere to a strict hierarchal color palette for elements (red for destructive elements, bright blue for primary elements, blue/grey for secondary elements, etc). Therefore, IMO a custom tag colors feature should be implemented in a way that avoids color collisions with the core UI color palette.

@xx790
Copy link
Author

xx790 commented Nov 27, 2022

I mean, I can approximate it with a userscript to some extent.

  • I will have to put keywords in the tag description, since parent tags are hidden from HTML once there are more than one. And this won't work in places where only name is shown (especially tag badges);
  • Or I will have to maintain colors for all tags in the userscript, which is significantly less convenient.

And I have to check whether tampermonkey is happy to work on localhost:port urls. No luck on mobile (maybe if I use a separate browser specifically for stash).

I just think it is not just me and it can be useful for many people.

When only Hue is specified, it can be toned down (less saturation and lightness closer to regular background) so it won't collide with UI highlights.

@AdultSun
Copy link
Contributor

I've already been running a userscript to do this in Stash. It uses code prefixes in the tag name to know which color to use and also hides the prefix in most views. I was already using those leading codes to enforce a custom sort order for my tags already so it was the easiest way to do it. Ping me in Discord (same username) and I can send you a copy. Would be nice to get a native solution though since it's a little hacky.

Linking the issue "Sort_Name for Tags" #3108 since it's related to the current solution for color-coding.

@xx790
Copy link
Author

xx790 commented Nov 28, 2022

@AdultSun So you introduced the notion of tag namespaces into stash essentially. Interesting.

Now I will be contemplating whether I should embrace it for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants