modules/gdextensions/common/sr_graph.cpp
// Get color from palette: warm, cool or neon.
Get color from palette: warm, cool or neon.
Get color from palette : warm cool or neon .
unsigned *rg_palette(const char *name, int num_colors) {
	static unsigned warm[][12] = {
		{},
		{ 0xFDB25F },
		{ 0xFFC96B, 0xF47942 },
		{ 0xFFC96B, 0xF47942, 0xAB412C },
		{ 0xFFD773, 0xF99851, 0xEF5833, 0x923E2D },
		{ 0xFFE67A, 0xFCAF5E, 0xF47942, 0xDA492D, 0x773A2D },
		{ 0xFFE77E, 0xFEBD65, 0xF78F4D, 0xF16137, 0xC1452C, 0x6F382E },
		{ 0xFFE782, 0xFFC76A, 0xFAA055, 0xF47942, 0xEF512F, 0xAE422C, 0x67382E },
		{ 0xFFE886, 0xFFD06F, 0xFBAD5D, 0xF68A4B, 0xF16739, 0xDE4A2D, 0xA0402C, 0x5F362F },
		{ 0xFFE98B, 0xFFD873, 0xFEB862, 0xF99851, 0xF47942, 0xEF5833, 0xCA462D, 0x913D2D, 0x573530 },
		{ 0xFFE98E, 0xFFDF76, 0xFFC267, 0xFAA458, 0xF68749, 0xF26A3A, 0xEE4C2D, 0xB9442C, 0x843C2D, 0x4F3330 },
		{ 0xFFE98E, 0xFFE278, 0xFFC76A, 0xFBAD5D, 0xF8934F, 0xF47942, 0xF05D35, 0xDE4A2D, 0xAE422C, 0x7F3B2D, 0x4F3330 },
		{ 0xFFE98E, 0xFFE479, 0xFFE479, 0xFEB460, 0xFA9C53, 0xF58547, 0xF58547, 0xEE5531, 0xD1492D, 0xA5402C, 0x7A3A2D, 0x4F3330 }
	};
	static unsigned cool[][12] = {
		{ 0x41BED1 },
		{ 0x78CCCF, 0x0B88B4 },
		{ 0x78CCCF, 0x0B88B4, 0x00357E },
		{ 0x96D5CD, 0x0CAAC9, 0x07669E, 0x002C71 },
		{ 0xB2DFCC, 0x3BBCD0, 0x0B88B4, 0x044F8F, 0x042561 },
		{ 0xBAE0CD, 0x5CC5CF, 0x0DA0C3, 0x096FA4, 0x044186, 0x05255C },
		{ 0xC3E2CC, 0x75CBCF, 0x10B1CE, 0x0B88B4, 0x0B88B4, 0x01377F, 0x052257 },
		{ 0xCCE5CC, 0x86D1CE, 0x33BBD1, 0x0C9AC0, 0x0A75A7, 0x065090, 0x002F79, 0x051F53 },
		{ 0xD4E8CC, 0x96D5CD, 0x52C2D0, 0x0CAAC9, 0x0B88B4, 0x07669E, 0x034589, 0x012B70, 0x061D4E },
		{ 0xDCEBCB, 0xA3DACD, 0x67C7CF, 0x0DB6D1, 0x0B97BE, 0x0B78A9, 0x065A96, 0x023D83, 0x042868, 0x061C49 },
		{ 0xDCEBCB, 0xA9DCCD, 0x75CBCF, 0x33BBD1, 0x33BBD1, 0x33BBD1, 0x096BA2, 0x065090, 0x01377F, 0x032766, 0x032766 },
		{ 0xDCEBCB, 0xAEDDCD, 0x7ECECE, 0x48C0D1, 0x10ADCC, 0x0B94BC, 0x0B7BAB, 0x09639B, 0x034A8B, 0x00337C, 0x032663, 0x061C49 }
	};
	static unsigned neon[][12] = {
		{ 0xF3648B },
		{ 0xF78495, 0xAD3E8C },
		{ 0xF78495, 0xAD3E8C, 0x502370 },
		{ 0xF9989B, 0xDE4C86, 0x7D3392, 0x461E63 },
		{ 0xFCACA4, 0xF2618A, 0xAD3E8C, 0x612B8A, 0x3C1955 },
		{ 0xFDB3A5, 0xF5738F, 0xD04888, 0x8A3590, 0x58277C, 0x3A1951 },
		{ 0xFEB9A7, 0xF68294, 0xEA5084, 0xAD3E8C, 0x703093, 0x512472, 0x37164C },
		{ 0xFFBFAA, 0xF88F98, 0xF25E89, 0xC84688, 0x93378F, 0x632C8C, 0x4B2069, 0x331548 },
		{ 0xFFC5AC, 0xF9999C, 0xF46E8D, 0xDE4C86, 0xAD3E8C, 0x7C3292, 0x5B2981, 0x451E62, 0x301443 },
		{ 0xFFCBAE, 0xFAA2A0, 0xF57A91, 0xF05384, 0xC44488, 0x97388E, 0x692F94, 0x552578, 0x411C5C, 0x2D133F },
		{ 0xFFCBAE, 0xFBA6A2, 0xF68294, 0xF25E89, 0xD64A87, 0xAD3E8C, 0x853491, 0x632C8C, 0x512472, 0x3F1B59, 0x2D133F },
		{ 0xFFCBAE, 0xFBAAA3, 0xF78997, 0xF3688C, 0xE54F85, 0xBF4489, 0x9C398D, 0x753193, 0x5E2985, 0x4D226D, 0x3D1A57, 0x2D133F }
	};
	if (strcmp(name, "warm") == 0) {
		switch (num_colors) {
			case 1:
			case 2:
			case 3:
			case 4:
			case 5:
			case 6:
			case 7:
			case 8:
			case 9:
			case 10:
			case 11:
			case 12:
				return warm[num_colors];
			default:
				return 0;
		}
	} else if (strcmp(name, "cool") == 0) {
		switch (num_colors) {
			case 1:
			case 2:
			case 3:
			case 4:
			case 5:
			case 6:
			case 7:
			case 8:
			case 9:
			case 10:
			case 11:
			case 12:
				return cool[num_colors];
			default:
				return 0;
		}
	} else if (strcmp(name, "neon") == 0) {
		switch (num_colors) {
			case 1:
			case 2:
			case 3:
			case 4:
			case 5:
			case 6:
			case 7:
			case 8:
			case 9:
			case 10:
			case 11:
			case 12:
				return neon[num_colors];
			default:
				return 0;
		}
	}
	return 0;
}
unsigned * rg_palette ( const char * name , int num_colors ) { static unsigned warm [ ] [ 12 ] = { { } , { 0xFDB25F } , { 0xFFC96B , 0xF47942 } , { 0xFFC96B , 0xF47942 , 0xAB412C } , { 0xFFD773 , 0xF99851 , 0xEF5833 , 0x923E2D } , { 0xFFE67A , 0xFCAF5E , 0xF47942 , 0xDA492D , 0x773A2D } , { 0xFFE77E , 0xFEBD65 , 0xF78F4D , 0xF16137 , 0xC1452C , 0x6F382E } , { 0xFFE782 , 0xFFC76A , 0xFAA055 , 0xF47942 , 0xEF512F , 0xAE422C , 0x67382E } , { 0xFFE886 , 0xFFD06F , 0xFBAD5D , 0xF68A4B , 0xF16739 , 0xDE4A2D , 0xA0402C , 0x5F362F } , { 0xFFE98B , 0xFFD873 , 0xFEB862 , 0xF99851 , 0xF47942 , 0xEF5833 , 0xCA462D , 0x913D2D , 0x573530 } , { 0xFFE98E , 0xFFDF76 , 0xFFC267 , 0xFAA458 , 0xF68749 , 0xF26A3A , 0xEE4C2D , 0xB9442C , 0x843C2D , 0x4F3330 } , { 0xFFE98E , 0xFFE278 , 0xFFC76A , 0xFBAD5D , 0xF8934F , 0xF47942 , 0xF05D35 , 0xDE4A2D , 0xAE422C , 0x7F3B2D , 0x4F3330 } , { 0xFFE98E , 0xFFE479 , 0xFFE479 , 0xFEB460 , 0xFA9C53 , 0xF58547 , 0xF58547 , 0xEE5531 , 0xD1492D , 0xA5402C , 0x7A3A2D , 0x4F3330 } } ; static unsigned cool [ ] [ 12 ] = { { 0x41BED1 } , { 0x78CCCF , 0x0B88B4 } , { 0x78CCCF , 0x0B88B4 , 0x00357E } , { 0x96D5CD , 0x0CAAC9 , 0x07669E , 0x002C71 } , { 0xB2DFCC , 0x3BBCD0 , 0x0B88B4 , 0x044F8F , 0x042561 } , { 0xBAE0CD , 0x5CC5CF , 0x0DA0C3 , 0x096FA4 , 0x044186 , 0x05255C } , { 0xC3E2CC , 0x75CBCF , 0x10B1CE , 0x0B88B4 , 0x0B88B4 , 0x01377F , 0x052257 } , { 0xCCE5CC , 0x86D1CE , 0x33BBD1 , 0x0C9AC0 , 0x0A75A7 , 0x065090 , 0x002F79 , 0x051F53 } , { 0xD4E8CC , 0x96D5CD , 0x52C2D0 , 0x0CAAC9 , 0x0B88B4 , 0x07669E , 0x034589 , 0x012B70 , 0x061D4E } , { 0xDCEBCB , 0xA3DACD , 0x67C7CF , 0x0DB6D1 , 0x0B97BE , 0x0B78A9 , 0x065A96 , 0x023D83 , 0x042868 , 0x061C49 } , { 0xDCEBCB , 0xA9DCCD , 0x75CBCF , 0x33BBD1 , 0x33BBD1 , 0x33BBD1 , 0x096BA2 , 0x065090 , 0x01377F , 0x032766 , 0x032766 } , { 0xDCEBCB , 0xAEDDCD , 0x7ECECE , 0x48C0D1 , 0x10ADCC , 0x0B94BC , 0x0B7BAB , 0x09639B , 0x034A8B , 0x00337C , 0x032663 , 0x061C49 } } ; static unsigned neon [ ] [ 12 ] = { { 0xF3648B } , { 0xF78495 , 0xAD3E8C } , { 0xF78495 , 0xAD3E8C , 0x502370 } , { 0xF9989B , 0xDE4C86 , 0x7D3392 , 0x461E63 } , { 0xFCACA4 , 0xF2618A , 0xAD3E8C , 0x612B8A , 0x3C1955 } , { 0xFDB3A5 , 0xF5738F , 0xD04888 , 0x8A3590 , 0x58277C , 0x3A1951 } , { 0xFEB9A7 , 0xF68294 , 0xEA5084 , 0xAD3E8C , 0x703093 , 0x512472 , 0x37164C } , { 0xFFBFAA , 0xF88F98 , 0xF25E89 , 0xC84688 , 0x93378F , 0x632C8C , 0x4B2069 , 0x331548 } , { 0xFFC5AC , 0xF9999C , 0xF46E8D , 0xDE4C86 , 0xAD3E8C , 0x7C3292 , 0x5B2981 , 0x451E62 , 0x301443 } , { 0xFFCBAE , 0xFAA2A0 , 0xF57A91 , 0xF05384 , 0xC44488 , 0x97388E , 0x692F94 , 0x552578 , 0x411C5C , 0x2D133F } , { 0xFFCBAE , 0xFBA6A2 , 0xF68294 , 0xF25E89 , 0xD64A87 , 0xAD3E8C , 0x853491 , 0x632C8C , 0x512472 , 0x3F1B59 , 0x2D133F } , { 0xFFCBAE , 0xFBAAA3 , 0xF78997 , 0xF3688C , 0xE54F85 , 0xBF4489 , 0x9C398D , 0x753193 , 0x5E2985 , 0x4D226D , 0x3D1A57 , 0x2D133F } } ; if ( strcmp ( name , " " ) == 0 ) { switch ( num_colors ) { case 1 : case 2 : case 3 : case 4 : case 5 : case 6 : case 7 : case 8 : case 9 : case 10 : case 11 : case 12 : return warm [ num_colors ] ; default : return 0 ; } } else if ( strcmp ( name , " " ) == 0 ) { switch ( num_colors ) { case 1 : case 2 : case 3 : case 4 : case 5 : case 6 : case 7 : case 8 : case 9 : case 10 : case 11 : case 12 : return cool [ num_colors ] ; default : return 0 ; } } else if ( strcmp ( name , " " ) == 0 ) { switch ( num_colors ) { case 1 : case 2 : case 3 : case 4 : case 5 : case 6 : case 7 : case 8 : case 9 : case 10 : case 11 : case 12 : return neon [ num_colors ] ; default : return 0 ; } } return 0 ; }
Get color from palette: warm, cool or neon.
Get color from palette : warm cool or neon .