Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8042055

Nimbus DerivedColor incorrectly clamps hue

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b08
    • CPU:
      x86
    • OS:
      windows_7

      Description

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      In javax.swing.plaf.nimbus.DerivedColor.rederiveColor, the hue/sat/brightness values are clamped to a 0 to 1 range after adding the offsets.

      This is incorrect for hue, since hues are cyclic. With the current implementation, large hue offsets will cause any hue to become red. This probably doesn't affect any existing code since Nimbus is mainly blue-grey-coloured, but it's still wrong.

      There is no need to apply clamping or wrapping logic to the hue value here, since java.awt.Color.HSBtoRGB already converts hues to a cyclic 0 to 1 range.


      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Activity

            People

            Assignee:
            psadhukhan Prasanta Sadhukhan
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: