mirror of
https://github.com/godotengine/godot.git
synced 2024-11-23 20:53:15 +00:00
Merge pull request #5022 from vnen/pr-fix-color8
Fix Color8 constructor using wrong value range
This commit is contained in:
commit
0e122566d0
@ -1010,11 +1010,11 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
|
||||
VALIDATE_ARG_NUM(1);
|
||||
VALIDATE_ARG_NUM(2);
|
||||
|
||||
Color color(*p_args[0],*p_args[1],*p_args[2]);
|
||||
Color color((float)*p_args[0]/255.0f,(float)*p_args[1]/255.0f,(float)*p_args[2]/255.0f);
|
||||
|
||||
if (p_arg_count==4) {
|
||||
VALIDATE_ARG_NUM(3);
|
||||
color.a=*p_args[3];
|
||||
color.a=(float)*p_args[3]/255.0f;
|
||||
}
|
||||
|
||||
r_ret=color;
|
||||
|
Loading…
Reference in New Issue
Block a user