Q:

OpenGL shader gamma on solid color

I want to implement gamma correction on my OpenGL 3D renderer, I understand that it's absolutely relevant on texture loaded in sRGB, so I do this:
vec4 texColor;
texColor = texture(src_tex_unit0, texCoordVarying);
texColor = vec4(pow(texColor.rgb,vec3(2.2)),1.0);
vec4 colorPreGamma = texColor * (vec4(ambient,1.0) + vec4(diffuse,1.0));
fragColor =  vec4(pow(colorPreGamma.rgb, vec3(1.0/gamma)),1.0);

But my question is about solid color, when the surface of the 3D object I want lit is not textured but just colored by a per vertex RGB value.  In this case, do I have to transform my color in Linear space, and after the lighting operation, transform back to gamma space like I do for a texture? 
Does this apply when my light are colored? 

A:

In OpenGL there isn't a huge distinction between color data and other kinds of data: if you have a vec3 you can access components as .xyz or .rgb.  It's all just data. 
So ask yourself this: "Do I have to gamma correct my vertex positions in the vertex shader?" 
Of course not, because your vertex positions are already in linear space.  So if you are similarly setting your vertex colors in linear space, again no gamma correction is needed. 
In other words, do you imagine vec3(0.5, 0.5, 0.5) as being a gray that is visually halfway between black and white?  Then you need gamma correction. 
Do you imagine it as being mathematically halfway between black and white (in terms of measurable light intensity)?  Then it's already linear.