Gui: Improve object random color#688
Merged
Merged
Conversation
Sample in a bounded HSV color space to improve color contrast against object selection, section and sketcher planes.
Author
|
Mmh, ironically I'm still sometimes getting garish colors in part design. I think part creation might use a different path. I'll have a look at that. |
Owner
|
Thanks. I'll follow up with new feature color randomization. |
realthunder
added a commit
that referenced
this pull request
Jan 25, 2023
Author
|
@realthunder Probably bad place to ask, but are you using some special cmake flags/setup to reduce rebuild times? I'm not sure whether it's the version stuff but I routinely incur in 1000+ objects to rebuild even from a trivial pull. |
Owner
|
No magic flags used. It just happened that I've recently pushed a few changes to some commonly used headers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sample in a bounded HSV color space to improve color contrast against object selection, section and sketcher planes.
I'm a heavy user of "object random color" when working. The current object color randomization can be pretty awful, selecting ultra-bright colors that conflict with the sketcher workplane, or impossible to distinguish dark hues.
This changes the random color to select mostly dull but still distinguishable colors that always have good contrast in all view modes (uniform, flat or shadow) and most non-solid/UI elements (sketches, pre/selections, and so on). This is similar in what several commercial CADs already do, although I noticed at least some cycle through a fixed unsaturated palette (onshape, *cough*).
Before:

After:

Loading some random model with several parts, this is how the current random object colors tend to fare while trying to pick the worst result in both with flat shading:
With the PR:
This is still implemented as a single-shot randomization without neighboring analysis (that is, we don't try to maximize contrast with close neighbors). Doing that would drastically improve the contrast against parts without having to change the colormap, although if you have "object random color" bound to a hotkey this is already not bad and orders of magnitudes better than the current status.