# Having trouble setting color in fragment shader

For some reason, the color isn't applying to the object. Here's my fragment shader code. There's probably something obvious wrong with it that i'm not seeing.

#version 330 core
out vec3 Color;

uniform int InColor;

void main()
{
Color = vec3(float(127 / 255), 0, 0);
}


The value 127 / 255 is an integer division and always has the value zero.
You want vec3(127.0 / 255.0, 0.0, 0.0) instead.
• You can divide integers, but in GLSL, as is the case in C, C++ and many other languages, the result of 127 / 255 will be 0. Apr 2 '14 at 0:51