فهرست منبع

fixed the not working text edit RGB field on color picker.

Anis 9 سال پیش
والد
کامیت
494922d9ed
1فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 5 3
      Engine/source/console/consoleFunctions.cpp

+ 5 - 3
Engine/source/console/consoleFunctions.cpp

@@ -879,9 +879,11 @@ DefineConsoleFunction(ColorHEXToRGB, ColorI, (const char* hex), ,
 	"@endtsexample\n"
 	"@endtsexample\n"
 	"@ingroup Strings")
 	"@ingroup Strings")
 {
 {
-	ColorI color;
-	color.set(hex);
-	return color;
+   S32 rgb = dAtoui(hex, 16);
+
+   ColorI color;
+   color.set(rgb & 0x000000FF, (rgb & 0x0000FF00) >> 8, (rgb & 0x00FF0000) >> 16);
+   return color;
 }
 }
 
 
 DefineConsoleFunction(ColorHSBToRGB, ColorI, (Point3I hsb), ,
 DefineConsoleFunction(ColorHSBToRGB, ColorI, (Point3I hsb), ,