-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
feat: Support custom user colors in tags #372
Conversation
Converts the tag color system to be based around a hex value rather than a named color system. This allows users to use any color they want for a tag, implemented via QColorDialog. Accent colors are then created at runtime for borders and text, etc.
When loading a library that contains the old named colors, the program will now automatically convert those to the hex value matching the old primary key. This will persist the new hex value when saved.
The predefined pallete colors are no longer necessary and were not being used anywhere, allowing them to be simply removed.
Marked as draft until #332 is merged, and I can update the stuff around it |
We discussed it in the Discord already, but I'll repost my take on this here to keep everything in one place: [...] I've intended custom tag colors to still have a name associated with them, so they would be proper objects with an |
Very outdated and sounded like Cyan is tackling. May open new PR if I get around to updating |
Hex-based colors
In order to support custom colors, tags must be moved away from the fixed name color system and are instead transitioned to a single primary hex value. All other accents are now up to the front-end to generate (if they are necessary). This allows for the removal of the large tag color dictionary, though the key and primary color hex remain for legacy purporses. A check is added to library loading to replace old fixed-named colors with their primary hex key.
Custom colors
QT provides an os-native color picker dialog complete with a full color spectrum, default colors, saving of colors, and an eye-dropper utility. The old color dropdown has been replaced with a push button that opens the color dialog modal and updates to reflect the selected color. The QColor class is also used for generating accent colors as it provides simple helper functions to create off-set colors.
closes #264