How do you plan to enter the light component's literal numerical values without a color dialog
For me that's the easy part, i plan to use only the predefined color constants already used there:
WCHAR zColor[] = L"aliceblue,0xfff8f0,antiquewhite,0xd7ebfa,aqua,0xffff00,aquamarine,0xd4ff7f,azure,0xfffff0,beige,0xdcf5f5,bisque,0xc4e4ff,black,0x000001,blue,0xff0000,blueviolet,0xe22b8a,brown,0x2a2aa5,burlywood,0x87b8de,cadetblue,0xa09e5f,chartreuse,0x00ff7f,chocolate,0x1e69d2,coral,0x507fff,cornflowerblue,0xed9564,crimson,0x3c14dc,cyan,0xffff00,darkblue,0x8b0000,darkcyan,0x8b8b00,darkgoldenrod,0x0b86b8,darkgray,0xa9a9a9,darkgreen,0x006400,darkkhaki,0x6bb7bd,darkolivegreen,0x2f6b55,darkorange,0x008cff,darkred,0x00008b,darksalmon,0x7a96e9,darkseagreen,0x8bbc8f,darkslateblue,0x8b3d48,darkslategray,0x4f4f2f,darkturquoise,0xd1ce00,deeppink,0x9314ff,deepskyblue,0xffbf00,dimgray,0x696969,dodgerblue,0xff901e,feldspar,0x7692d2,firebrick,0x2222b2,forestgreen,0x228b22,gainsboro,0xdcdcdc,gold,0x00d7ff,goldenrod,0x20a5da,gray,0x808080,green,0x008000,greenyellow,0x2fffad,honeydew,0xf0fff0,hotpink,0xb469ff,indianred,0x5c5ccd,indigo,0x82004b,ivory,0xf0ffff,khaki,0x8ce6f0,lavender,0xfae6e6,lavenderblush,0xf5f0ff,lawngreen,0x00fc7c,lemonchiffon,0xcdfaff,lightblue,0xe6d8ad,lightcoral,0x8080f0,lightcyan,0xffffe0,lightgoldenrodyellow,0xd2fafa,lightgray,0xd3d3d3,lightgreen,0x90ee90,lightpink,0xc1b6ff,lightsalmon,0x7aa0ff,lightseagreen,0xaab220,lightskyblue,0xface87,lightslategray,0x998877,lightyellow,0xe0ffff,lime,0x00ff00,limegreen,0x32cd32,linen,0xe6f0fa,magenta,0xff00ff,maroon,0x000080,mediumaquamarine,0xaacd66,mediumblue,0xcd0000,mediumorchid,0xd355ba,mediumpurple,0xdb7093,mediumseagreen,0x71b33c,mediumslateblue,0xee687b,mediumspringgreen,0x9afa00,midnightblue,0x701919,mintcream,0xfafff5,mistyrose,0xe1e4ff,moccasin,0xb5e4ff,navy,0x800000,oldlace,0xe6f5fd,olive,0x008080,olivedrab,0x238e6b,orange,0x00a5ff,orangered,0x0045ff,palegoldenrod,0xaae8ee,palegreen,0x98fb98,palevioletred,0x9370db,papayawhip,0xd5efff,peachpuff,0xb9daff,peru,0x3f85cd,pink,0xcbc0ff,plum,0xdda0dd,powderblue,0xe6e0b0,purple,0x800080,red,0x0000ff,rosybrown,0x8f8fbc,royalblue,0xe16941,saddlebrown,0x13458b,salmon,0x7280fa,sandybrown,0x60a4f4,seagreen,0x578b2e,sienna,0x2d52a0,silver,0xc0c0c0,skyblue,0xebce87,slateblue,0xcd5a6a,slategray,0x908070,snow,0xfafaff,springgreen,0x7fff00,steelblue,0xb48246,tan,0x8cb4d2,teal,0x808000,thistle,0xd8bfd8,tomato,0x4763ff,turquoise,0xd0e040,violet,0xee82ee,violetred,0x5f20d0,wheat,0xb3def5,white,0xffffff,yellow,0x00ffff,yellowgreen,0x32cd9a,";
and here is how i assign them using the hidden color listbox
for (long K = 0; K < nCount; K++) {
nRGB = (long) SendMessage(gP.hColorList, LB_GETITEMDATA, K, 0);
nARGB = ZD_ColorARGB(255, nRGB);
nCol++;
nID = K + 1000;
if (ZD_DrawRectangleToCtrl(hWnd, x, y, w, h, ZD_ColorARGB(255, 0), 1, nID+1000, ZS_VISIBLE, ZD_DRAW_OUTLINE, 0)) {
//if (ZD_DrawEllipseToCtrl(hWnd, x, y, x+w, y+h, nARGB, 0, nID, ZS_VISIBLE, ZD_DRAW_FILLED, 0)) {
SetObjectAnchorMode(nID+1000, ANCHOR_BOTTOM);
ZD_SetObjectLocked(nID, TRUE);
ZD_DrawRectangleToCtrl(hWnd, x+1, y+1, w-2, h-2, nARGB, 0, nID, ZS_VISIBLE, ZD_DRAW_FILLED, 0);
SetObjectAnchorMode(nID, ANCHOR_BOTTOM);
ZD_SetObjectImageLabel(nID, TipFormat(List_GetText(gP.hColorList, K + 1)));
ZD_SetObjectLocked(nID, TRUE);
}
if (nCol > 6) {
nCol = 0;
x = xOrigine;
y += h + 2;
} else {
x += w + 2;
}
}
and the new macro
#define COLORAMB(n) \
r = (BYTE)(255 * amblight##n##_buf[0]); \
g = (BYTE)(255 * amblight##n##_buf[1]); \
b = (BYTE)(255 * amblight##n##_buf[2]);
#define COLORDIF(n) \
r = (BYTE)(255 * diflight##n##_buf[0]); \
g = (BYTE)(255 * diflight##n##_buf[1]); \
b = (BYTE)(255 * diflight##n##_buf[2]);
#define COLORSPEC(n) \
r = (BYTE)(255 * speclight##n##_buf[0]); \
g = (BYTE)(255 * speclight##n##_buf[1]); \
b = (BYTE)(255 * speclight##n##_buf[2]);
to set them this way:
COLORAMB(0); ZD_DrawRectangleToCtrl(hWnd, xOrigine, y, bmW, bmH, ZD_ARGB(255, r, g, b), 0, nID, ZS_VISIBLE, ZD_DRAW_FILLED, 0); ZD_SetObjectLocked(nID, TRUE);
//ZD_SetObjectImageLabel(nID, TipFormat(List_GetText(gP.hColorList, K + 1)));
nID--; y = y; ZD_DrawTextToCtrlEx(hWnd, L"Front ambient", x, y, 0, 0, nARGB, fontname, nFontSize, nID, ZS_VISIBLE, nShadow, 0); ZD_SetObjectHidden(nID, ZS_INACTIVE);
This is what has been already documented there:
