1

Can you help me how can i change HSV to RGB ?

hidell
  • 21
  • 2

2 Answers2

0

Your color object is probably has setters for the HSV members....

So you need to define the 3 slider to play with the H,S and V values..

remember:

enter image description here

  • Hue : the color type (red, blue, or yellow) Ranges from 0 to 360°

  • Saturation : the intensity of the color. Ranges from 0 to 100%

  • Brightness (or Value) : the brightness of the color. Ranges from 0 to 100%


QImage myImage = ....
QColor myColor = myImage.pixelColor(...);
myColor.setHsv(....);
ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97
0

You mean you want to shift HS and V over the whole image by a value? Easy enough, centre your sliders at 0 and allow hue to go from -2PI to 2PI, and s and v to go from -1.0 to 1.0. Hue can't go out of range, it wraps to +/- PI or whatever convention you use. S and V are clamped to 0 - 1, (or 0 - 255 if you use bytes instead of floats).

You will need HSVtoRGB and RGBtoHSV, which is readily available on the web.

Malcolm McLean
  • 6,258
  • 1
  • 17
  • 18