How can I use the HSL colorspace in Java?

前端 未结 6 1072
遇见更好的自我
遇见更好的自我 2021-02-12 22:51

I\'ve had a look at the ColorSpace class, and found the constant TYPE_HLS (which presumably is just HSL in a different order).

Can I use this const

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-12 23:18

    Maybe this will help. The JDK doesn't seem to be very helpful when wanting to use colors in another color space.

    Edit: In ColorSpace.getName(idx) there's this little snippet:

     case ColorSpace.TYPE_HLS:
                        compName = new String[] {"Hue", "Lightness", 
                                                 "Saturation"};
    

    so it was what you thought, but looking at the type hierarchy of ColorSpace it doesn't seem to be used or implemented in any way anywhere. ColorSpace is extended by only two other classes BogusColorSpace and ICC_ColorSpace, so I'm guessing they're expecting developers to create their own implementations for different color spaces.

提交回复
热议问题