Merge branch 'master' of https://github.com/raysan5/raygui
This commit is contained in:
commit
a9e5e90058
@ -3561,6 +3561,7 @@ int GuiColorBarHue(Rectangle bounds, const char *text, float *hue)
|
|||||||
// float GuiColorBarAlpha(Rectangle bounds, float alpha)
|
// float GuiColorBarAlpha(Rectangle bounds, float alpha)
|
||||||
// float GuiColorBarHue(Rectangle bounds, float value)
|
// float GuiColorBarHue(Rectangle bounds, float value)
|
||||||
// NOTE: bounds define GuiColorPanel() size
|
// NOTE: bounds define GuiColorPanel() size
|
||||||
|
// NOTE: this picker converts RGB to HSV, which can cause the Hue control to jump. If you have this problem, consider using the HSV variant instead
|
||||||
int GuiColorPicker(Rectangle bounds, const char *text, Color *color)
|
int GuiColorPicker(Rectangle bounds, const char *text, Color *color)
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
@ -3573,6 +3574,7 @@ int GuiColorPicker(Rectangle bounds, const char *text, Color *color)
|
|||||||
Rectangle boundsHue = { (float)bounds.x + bounds.width + GuiGetStyle(COLORPICKER, HUEBAR_PADDING), (float)bounds.y, (float)GuiGetStyle(COLORPICKER, HUEBAR_WIDTH), (float)bounds.height };
|
Rectangle boundsHue = { (float)bounds.x + bounds.width + GuiGetStyle(COLORPICKER, HUEBAR_PADDING), (float)bounds.y, (float)GuiGetStyle(COLORPICKER, HUEBAR_WIDTH), (float)bounds.height };
|
||||||
//Rectangle boundsAlpha = { bounds.x, bounds.y + bounds.height + GuiGetStyle(COLORPICKER, BARS_PADDING), bounds.width, GuiGetStyle(COLORPICKER, BARS_THICK) };
|
//Rectangle boundsAlpha = { bounds.x, bounds.y + bounds.height + GuiGetStyle(COLORPICKER, BARS_PADDING), bounds.width, GuiGetStyle(COLORPICKER, BARS_THICK) };
|
||||||
|
|
||||||
|
// NOTE: this conversion can cause low hue-resolution, if the r, g and b value are very similar, which causes the hue bar to shift around when only the GuiColorPanel is used.
|
||||||
Vector3 hsv = ConvertRGBtoHSV(RAYGUI_CLITERAL(Vector3){ (*color).r/255.0f, (*color).g/255.0f, (*color).b/255.0f });
|
Vector3 hsv = ConvertRGBtoHSV(RAYGUI_CLITERAL(Vector3){ (*color).r/255.0f, (*color).g/255.0f, (*color).b/255.0f });
|
||||||
|
|
||||||
GuiColorBarHue(boundsHue, NULL, &hsv.x);
|
GuiColorBarHue(boundsHue, NULL, &hsv.x);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user