parent
70edfcdc8d
commit
57a78ec06b
1 changed files with 6 additions and 2 deletions
|
@ -302,8 +302,8 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) {
|
||||||
case COLOR: {
|
case COLOR: {
|
||||||
|
|
||||||
static const Type valid[] = {
|
static const Type valid[] = {
|
||||||
//STRING,
|
STRING,
|
||||||
//INT,
|
INT,
|
||||||
NIL,
|
NIL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1653,6 +1653,10 @@ Variant::operator Color() const {
|
||||||
|
|
||||||
if (type==COLOR)
|
if (type==COLOR)
|
||||||
return *reinterpret_cast<const Color*>(_data._mem);
|
return *reinterpret_cast<const Color*>(_data._mem);
|
||||||
|
else if (type==STRING)
|
||||||
|
return Color::html( operator String() );
|
||||||
|
else if (type==INT)
|
||||||
|
return Color::hex( operator int() );
|
||||||
else
|
else
|
||||||
return Color();
|
return Color();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue