mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Switch (back) to our own Color type instead of using wxColour.
The reason is that wxColour's default constructor creates an invalid color (what is that even?). It is nicer to just have default be transparent.
This commit is contained in:
@@ -94,7 +94,7 @@ SCRIPT_FUNCTION(recolor_image) {
|
||||
SCRIPT_OPTIONAL_PARAM(Color, red) {
|
||||
SCRIPT_PARAM(Color, green);
|
||||
SCRIPT_PARAM(Color, blue);
|
||||
SCRIPT_PARAM_DEFAULT(Color, white, *wxWHITE);
|
||||
SCRIPT_PARAM_DEFAULT(Color, white, Color(255,255,255));
|
||||
return make_intrusive<RecolorImage2>(input,red,green,blue,white);
|
||||
} else {
|
||||
SCRIPT_PARAM(Color, color);
|
||||
|
||||
@@ -341,11 +341,11 @@ public:
|
||||
}
|
||||
}
|
||||
Color toColor() const override {
|
||||
Color c = parse_color(value);
|
||||
if (!c.Ok()) {
|
||||
optional<Color> c = parse_color(value);
|
||||
if (!c.has_value()) {
|
||||
throw ScriptErrorConversion(value, typeName(), _TYPE_("color"));
|
||||
}
|
||||
return c;
|
||||
return *c;
|
||||
}
|
||||
wxDateTime toDateTime() const override {
|
||||
wxDateTime date;
|
||||
|
||||
Reference in New Issue
Block a user