bool CmKeyboard::SetLEDs(COLORREF pixels[64][256])
{
#ifdef COOLER_MASTER_ENABLED
	if (INITED == true)
    {
		for (int i = 0; i < 6; i++)
        {
			for (int j = 0; j < dev_column; j++)
            {
				if (LED_TABLE[i][j] >= 0)
                {
					cm.KeyColor[i][j].r = GetRValue(pixels[y_idx_list[i]][(int)(col * LED_TABLE[i][j]) + col]);
					cm.KeyColor[i][j].g = GetGValue(pixels[y_idx_list[i]][(int)(col * LED_TABLE[i][j]) + col]);
					cm.KeyColor[i][j].b = GetBValue(pixels[y_idx_list[i]][(int)(col * LED_TABLE[i][j]) + col]);
				}
				
			}
		}
		if (SetAllLedColor(cm) == false)
        {
			SetAllLedColor(cm);
		}
	}

	return INITED;
#else
    return FALSE;
#endif
}
bool CmKeyboard::SetLEDs(COLORREF pixels[64][256]) {
	
	if (INITED == true) {
		for (int i = 0; i < 6; i++) {
			for (int j = 0; j < dev_column; j++) {
				if (LED_TABLE[i][j] >= 0) {
					cm.KeyColor[i][j].r = GetRValue(pixels[row * i + row][(int)(col * LED_TABLE[i][j]) + col]);
					cm.KeyColor[i][j].g = GetGValue(pixels[row * i + row][(int)(col * LED_TABLE[i][j]) + col]);
					cm.KeyColor[i][j].b = GetBValue(pixels[row * i + row][(int)(col * LED_TABLE[i][j]) + col]);
				}
				
			}
		}
		if (SetAllLedColor(cm) == false) {
			SetAllLedColor(cm);
		}
	}

	return INITED;
}