Corrected issue with GuiCOlorPicker() drifting
This commit is contained in:
parent
8c33be58b2
commit
4643d3769d
@ -520,6 +520,7 @@ RAYGUIDEF bool GuiCheckIconPixel(int iconId, int x, int y); // Check icon pi
|
||||
|
||||
#include <stdio.h> // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), vsprintf()
|
||||
#include <string.h> // Required for: strlen() on GuiTextBox()
|
||||
#include <math.h> // Required for: roundf() on GuiColorPicker()
|
||||
|
||||
#if defined(RAYGUI_STANDALONE)
|
||||
#include <stdarg.h> // Required for: va_list, va_start(), vfprintf(), va_end()
|
||||
@ -2548,7 +2549,7 @@ Color GuiColorPicker(Rectangle bounds, Color color)
|
||||
hsv.x = GuiColorBarHue(boundsHue, hsv.x);
|
||||
//color.a = (unsigned char)(GuiColorBarAlpha(boundsAlpha, (float)color.a/255.0f)*255.0f);
|
||||
Vector3 rgb = ConvertHSVtoRGB(hsv);
|
||||
color = RAYGUI_CLITERAL(Color){ (unsigned char)(rgb.x*255.0f), (unsigned char)(rgb.y*255.0f), (unsigned char)(rgb.z*255.0f), color.a };
|
||||
color = RAYGUI_CLITERAL(Color){ (unsigned char)roundf(rgb.x*255.0f), (unsigned char)roundf(rgb.y*255.0f), (unsigned char)roundf(rgb.z*255.0f), color.a };
|
||||
|
||||
return color;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user