Search code examples
c++visual-studiovisual-studio-2010openglcolor-picker

Color Picker / Choser for an OpenGL Application


I am building an OpenGL application. I read through the GLUI tutorial on Code Project to create windows form controls on an OpenGL Application. But my requirement is to develop a color choser/picker, like an RGB chart or RGB cube to select a color. The tutorial on Code project shows the list of colors as a drop down box. However that wont really help me, as I require it to be present as a windows color picker. I know that color picker as a dialog box is a part of the windows application. Can anyone suggest me a way to use it with my OpenGL Application?


Solution

  • You could render a Quad/Triangle/Cirle with different color on each vertex
    and activate smooth shading for interpolation between these points.

    Then just read back the color value from OpenGL at the mouse position.

    edit: or like that where you calculate the color on the mouse position by yourself (reading values slows down OpenGL a lot!): http://sharathpatali.wordpress.com/2009/07/07/a-color-picker-for-pymt/