Skip to content

Conversation

@victorreijgwart
Copy link
Member

@victorreijgwart victorreijgwart commented Aug 27, 2020

This PR implements new color maps to make it easier to visualize unique IDs, with the following goals:

  • knowledge of the max ID should not be required, such that new IDs can be added without ever having to change the colors of past IDs
  • the colors for different IDs should remain as distinguishable as possible, so colors should not repeat and spread well across the color wheel
  • the colors should communicate which IDs are subsequent, for example by being (roughly) constantly spaced on the color wheel

Two color maps are implemented, based on

  1. Division by an irrational number followed, which results in a fractional left over that never repeats. See the left plot in the gif below.
  2. Constant steps that are offset such that the colors on subsequent revolutions always fall in between those of previous revolutions. See the right plot in the gif below.

Illustration:
Note that the colors in question are shown in the bottom row. The colors in the top two rows only illustrate which samples are subsequent.
ezgif com-video-to-gif (2)

@victorreijgwart victorreijgwart force-pushed the feature/color_wheel_for_unique_ids branch from 6e7ab06 to 6e3e0c0 Compare August 27, 2020 16:31
Copy link
Collaborator

@alexmillane alexmillane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for doing this.


void setItemsPerRevolution(uint value) { items_per_revolution_ = value; }

virtual Color colorLookup(size_t value) const {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and above, I personally make pass-by-value arguments const. It's saved me a few times from making assignment-instead-of-comparison mistakes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, thanks.

@victorreijgwart victorreijgwart merged commit 6fee247 into master Aug 28, 2020
@victorreijgwart victorreijgwart deleted the feature/color_wheel_for_unique_ids branch August 28, 2020 10:56
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.

3 participants