Merge pull request #12234 from marcelofg55/color8_fix

Fix Color.r8/g8/b8/a8 being type float instead of type int
This commit is contained in:
Gilles Roudiere 2017-10-20 10:26:44 +02:00 committed by GitHub
commit 62ed861774
1 changed files with 4 additions and 4 deletions

View File

@ -1655,13 +1655,13 @@ Variant Variant::get_named(const StringName &p_index, bool *r_valid) const {
} else if (p_index == CoreStringNames::singleton->a) {
return v->a;
} else if (p_index == CoreStringNames::singleton->r8) {
return v->r * 255.0;
return int(v->r * 255.0);
} else if (p_index == CoreStringNames::singleton->g8) {
return v->g * 255.0;
return int(v->g * 255.0);
} else if (p_index == CoreStringNames::singleton->b8) {
return v->b * 255.0;
return int(v->b * 255.0);
} else if (p_index == CoreStringNames::singleton->a8) {
return v->a * 255.0;
return int(v->a * 255.0);
} else if (p_index == CoreStringNames::singleton->h) {
return v->get_h();
} else if (p_index == CoreStringNames::singleton->s) {