set hue on color panel

This commit is contained in:
Simon 2019-06-30 11:13:26 +01:00
parent c20fc9f486
commit 4096ed02b5

View File

@ -3643,7 +3643,7 @@ RAYGUIDEF bool GuiListViewEx(Rectangle bounds, const char **text, int count, int
}
// Color Panel control
RAYGUIDEF Color GuiColorPanel(Rectangle bounds, Color color)
RAYGUIDEF Color GuiColorPanelEx(Rectangle bounds, Color color, float hue)
{
GuiControlState state = guiState;
Vector2 pickerSelector = { 0 };
@ -3654,7 +3654,7 @@ RAYGUIDEF Color GuiColorPanel(Rectangle bounds, Color color)
pickerSelector.x = bounds.x + (float)hsv.y*bounds.width; // HSV: Saturation
pickerSelector.y = bounds.y + (1.0f - (float)hsv.z)*bounds.height; // HSV: Value
Vector3 maxHue = { hsv.x, 1.0f, 1.0f };
Vector3 maxHue = { hue >= 0.0f ? hue : hsv.x, 1.0f, 1.0f };
Vector3 rgbHue = ConvertHSVtoRGB(maxHue);
Color maxHueCol = { (unsigned char)(255.0f*rgbHue.x),
(unsigned char)(255.0f*rgbHue.y),
@ -3717,6 +3717,10 @@ RAYGUIDEF Color GuiColorPanel(Rectangle bounds, Color color)
return color;
}
RAYGUIDEF Color GuiColorPanel(Rectangle bounds, Color color) {
return GuiColorPanelEx(bounds, color, -1.0f);
}
// Color Bar Alpha control
// NOTE: Returns alpha value normalized [0..1]
RAYGUIDEF float GuiColorBarAlpha(Rectangle bounds, float alpha)