Reputation: 79
How can I take the values from a PGM file, set the value as the color, then use that color to fillRect()
?
Upvotes: 0
Views: 51
Reputation: 38744
I'd say the easiest is to transform the PGM color to a Java Color is using HSB to express the PGM grayscale.
new Color(Color.HSBtoRGB(0, 0, (float)actualValue/maximumValueFromPGMHeader))
Upvotes: 1