Converting from HSV (HSB in Java) to RGB without using java.awt.Color (disallowed on Google App Engine)

前端 未结 7 1206
独厮守ぢ
独厮守ぢ 2020-12-09 12:44

I figured I should post this question, even if I have already found a solution, as a Java implementation was not readily available when I searched for it.

Using HSV

7条回答
  •  渐次进展
    2020-12-09 13:18

    You should use the HSBtoRGB implementation provided by Oracle, copying its source code into your project. java.awt.Color is open-source. The algorithms provided by Peter Recore and Yngling are not robust and will return illegal RGB values like "256,256,0" for certain inputs. Oracle's implementation is robust, use it instead.

提交回复
热议问题