Color mixing

does any body have any idea how to perform the **color mixing operation in open frameworks???
1.When two colors are selected and mixed the resultant color should be obtained,
2.I should be able to perform real time painting on a face using this color.

Please help me how to do this or how to start off.
Any help will be appreciable. :frowning:

i’m not an openframeworks guru so mayebe there is some classes or API for that.

but i think that this could be one possible approach could involve color theory:

  • a color is a point in a color space colro-space
  • you could switch between color space with some cool colrospace conversion functions (for example: rgb-to-hsl )
  • you could interpolate your colour-point with some interpolation function like ofLerp

for example from a blue to red you could use"">HSL
use some Saturation and Light fixed values,
modify Hue starting from 0° (red) to 240° (blue),
came back to rgb to use opengl API.
and this interpolation will pass throug yellow and green.

nkint is right, you probably want to use HSV, there’s some code here for HSV mixing: