diff options
Diffstat (limited to 'core/variant')
-rw-r--r-- | core/variant/variant.cpp | 2 | ||||
-rw-r--r-- | core/variant/variant_construct.cpp | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp index 7824776fdb..015cee09a7 100644 --- a/core/variant/variant.cpp +++ b/core/variant/variant.cpp @@ -2023,7 +2023,7 @@ Variant::operator Color() const { if (type == COLOR) { return *reinterpret_cast<const Color *>(_data._mem); } else if (type == STRING) { - return Color::html(operator String()); + return Color(operator String()); } else if (type == INT) { return Color::hex(operator int()); } else { diff --git a/core/variant/variant_construct.cpp b/core/variant/variant_construct.cpp index 9835734583..52f9f6060e 100644 --- a/core/variant/variant_construct.cpp +++ b/core/variant/variant_construct.cpp @@ -688,6 +688,8 @@ void Variant::_register_variant_constructors() { add_constructor<VariantConstructor<Color, Color, double>>(sarray("from", "alpha")); add_constructor<VariantConstructor<Color, double, double, double>>(sarray("r", "g", "b")); add_constructor<VariantConstructor<Color, double, double, double, double>>(sarray("r", "g", "b", "a")); + add_constructor<VariantConstructor<Color, String>>(sarray("code")); + add_constructor<VariantConstructor<Color, String, double>>(sarray("code", "alpha")); add_constructor<VariantConstructNoArgs<StringName>>(sarray()); add_constructor<VariantConstructor<StringName, StringName>>(sarray("from")); |