Matching exported data to color map

Hello,

I’ve exported some texture data from Molflow and would like to match my data analysis to your existing color map scheme used in texture scaling. Would it be possible to give some insight about the color map you use and how it’s applied to the texture?

Hello Alejandro.
Molflow uses the rainbow color map (red to purple).
The exact settings (min/max and lin/log) for a model can be seen in Texture Scaling.
The rainbow color map is extensively documented in literature (example), and the exact code that generates the RGB values is this:

First we define the eight base colors (RRGGBB, all hex values):

// Rainbow eight base colors
unsigned long rainbowCol[] = { 0x000000,   //Black
						0xFF0000,   //Red
						0xFF8030,   //Orange
						0xF8F800,   //Yellow
						0x28FF28,   //Green
						0x0040FF,   //Light Blue
						0x0000B0,   //Dark Blue
						0x800090,   //Purple 1
						0xF00080 };  //Purple 2

Then we generate the RGB values from 0 to 65535, always interpolating between the nearest two base colors:

std::vector<int> GLGradient::GenerateColorMap()
{
	std::vector<int> colorMap(65536);

	for (int i = 0; i < 65536; i++) {

		double r1, g1, b1;
		double r2, g2, b2;
		int colId = i / 8192; //8192= 65536 steps / 8 colors

                //Lower base color
		r1 = (double)((rainbowCol[colId] >> 16) & 0xFF);
		g1 = (double)((rainbowCol[colId] >> 8) & 0xFF);
		b1 = (double)((rainbowCol[colId] >> 0) & 0xFF);

                //Higher base color
		r2 = (double)((rainbowCol[colId + 1] >> 16) & 0xFF);
		g2 = (double)((rainbowCol[colId + 1] >> 8) & 0xFF);
		b2 = (double)((rainbowCol[colId + 1] >> 0) & 0xFF);

                //Lin. interpolate between the two
		double rr = (double)(i - colId * 8192) / 8192.0;
		Saturate(rr, 0.0, 1.0);
		colorMap[i] = (unsigned long)((int)(r1 + (r2 - r1)*rr) +
			(int)(g1 + (g2 - g1)*rr) * 256 +
			(int)(b1 + (b2 - b1)*rr) * 65536);

	}
	colorMap[65535] = 0xFFFFFF; // Saturation color (white)

	return colorMap;
}