09-01-2021 12:37 AM
I was able to find some answers with a question a while ago. I can draw a color palette, but I want to know one more thing.
I think the numerical control and the calaparet match, and I want to adjust the numerical control to have the results of the matching color. ColorMapEntry can find distinct colors, but not interpolated colors in between. What can I do?
Since my explanation is difficult, I will explain it with pictures.
I need your help.
Solved! Go to Solution.
09-01-2021 08:14 PM
I checked the code one by one.
I finally found a way. It wasn't a difficult way.
I have to try a little harder.
I will stop asking questions about this.
/* Ramp code
else
{
int red1;
int blue1;
int green1;
int red2;
int blue2;
int green2;
double offset;
red1 = (colorMap[i].color & 0x00FF0000) >> 16;
green1 = (colorMap[i].color & 0x0000FF00) >> 8;
blue1 = (colorMap[i].color & 0x000000FF);
red2 = (colorMap[i + 1].color & 0x00FF0000) >> 16;
green2 = (colorMap[i + 1].color & 0x0000FF00) >> 8;
blue2 = (colorMap[i + 1].color & 0x000000FF);
offset = fabs ((val - colorMap[i].dataValue.valDouble)
/ (colorMap[i + 1].dataValue.valDouble
- colorMap[i].dataValue.valDouble));
newColor = MakeColor(red1 + offset * (red2 - red1),
green1
+ offset * (green2 - green1),
blue1 + offset * (blue2 - blue1));
}
}
*/