Skip to content

Gui: Improve object random color#688

Merged
realthunder merged 1 commit into
realthunder:LinkDailyfrom
wavexx:hsv_rnd_color
Jan 25, 2023
Merged

Gui: Improve object random color#688
realthunder merged 1 commit into
realthunder:LinkDailyfrom
wavexx:hsv_rnd_color

Conversation

@wavexx

@wavexx wavexx commented Jan 17, 2023

Copy link
Copy Markdown

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.

Sample in a bounded HSV color space to improve color contrast against
object selection, section and sketcher planes.
@wavexx

wavexx commented Jan 17, 2023

Copy link
Copy Markdown
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.

@realthunder realthunder merged commit 0a9eabf into realthunder:LinkDaily Jan 25, 2023
@realthunder

Copy link
Copy Markdown
Owner

Thanks. I'll follow up with new feature color randomization.

realthunder added a commit that referenced this pull request Jan 25, 2023
@wavexx

wavexx commented Jan 31, 2023

Copy link
Copy Markdown
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.

@realthunder

Copy link
Copy Markdown
Owner

No magic flags used. It just happened that I've recently pushed a few changes to some commonly used headers.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants