I am using a Scalar to define the color of a rectangle I am drawing with OpenCV:
Scalar
OpenCV
rectangle(imgOriginal, Point(0, 0), Point(25, 50),
Although not optimal, You can use the following:
Scalar ScalarHSV2BGR(uchar H, uchar S, uchar V) { Mat rgb; Mat hsv(1,1, CV_8UC3, Scalar(H,S,V)); cvtColor(hsv, rgb, CV_HSV2BGR); return Scalar(rgb.data[0], rgb.data[1], rgb.data[2]); }