FirephoenixX02
FirephoenixX02

Reputation: 56

Can't use Blue Color Value in OpenGL 11

If i try to use GL11.glColor4f(85, 255, 0, 1) it works perfectly fine but as soon as i try to use the blue color value (GL11.glColor4f(85, 255, 255, 1) it just doesn't color at all.

Upvotes: 2

Views: 61

Answers (1)

Yakov Galka
Yakov Galka

Reputation: 72539

glColor4f expects values between 0 and 1, so that (0,0,0) is black and (1,1,1) is white. If you pass values greater than 1 they are getting clamped. Thus glColor4f(85, 255, 255, 1) will produce a white color. You should instead use

glColor4f(85/255., 1, 0, 1) 
glColor4f(85/255., 1, 1, 1) 

Upvotes: 2

Related Questions