Skip to content

make igl::hsv_to_rgb work correctly for negative hues #1397

@evouga

Description

@evouga

Describe your issue

Not strictly a bug since the hsv_to_rgb header does specify a range [0, 360] for the hue, but since the main point of HSV colormaps is hue periodicity, it would be nice if hsv_to_rgb worked correctly for all input h (right now it gives undefined output for negative hues). This amount to the change:

hh = ((360 + ((int)h % 360)) % 360) / 60.;

Check all that apply (change to [x])

  • Windows
  • Mac OS X
  • Linux
  • I have tried the dev branch and the problem persists

See https://libigl.github.io/CONTRIBUTING/#bugreport for more tips.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions