9 RGBtoHSV(begin_rgb(0), begin_rgb(1), begin_rgb(2), begin_hsv(0), begin_hsv(1), begin_hsv(2));
11 RGBtoHSV(end_rgb(0), end_rgb(1), end_rgb(2), end_hsv(0), end_hsv(1), end_hsv(2));
14 res.conservativeResize(Eigen::NoChange, nsteps);
20 for (
int i = 0; i < nsteps; ++i)
22 interp = double(i)/(nsteps - 1);
24 h = interp*end_hsv(0) + (1 - interp)*begin_hsv(0);
26 s = interp*end_hsv(1) + (1 - interp)*begin_hsv(1);
28 v = interp*end_hsv(2) + (1 - interp)*begin_hsv(2);
30 HSVtoRGB(res(0, i), res(1, i), res(2, i), h, s, v);
Eigen::Matrix3Xd interpolateColors(Eigen::Vector3d begin_rgb, Eigen::Vector3d end_rgb, int nsteps)
void RGBtoHSV(double &fR, double &fG, double fB, double &fH, double &fS, double &fV)
Convert RGB to HSV color space.
void HSVtoRGB(double &fR, double &fG, double &fB, double &fH, double &fS, double &fV)
Convert HSV to RGB color space.