GLSL's mix() linearly interpolates between two colors by a 0.0–1.0 factor
The built-in mix(colorA, colorB, t) performs linear interpolation: at t=0.0 the result is colorA, at t=1.0 it is colorB, at t=0.5 an equal blend. The third argument can be a float (one blend ratio for all channels) or a vec3/vec4 (an independent ratio per channel). Passing a vec3 lets each color channel blend at its own rate, enabling non-uniform gradients such as sunsets or palette morphs. Animating t with a time-varying signal (e.g. abs(sin(u_time))) produces continuous color oscillation. mix() is the primary tool for smooth color animation in fragment shaders.
Examples
vec3 colorA = vec3(1.0, 0.0, 0.0); // red
vec3 colorB = vec3(0.0, 0.0, 1.0); // blue
vec3 mixed = mix(colorA, colorB, abs(sin(u_time))); // oscillate red↔blue
vec3 perChan = mix(colorA, colorB, vec3(0.9, 0.2, 0.5)); // each channel differs
Assessment
Write a fragment shader that blends orange→cyan across the screen using normalized gl_FragCoord.x. Then extend it so each channel blends at a different rate and describe the visual difference.