Remove AColor class, because wxColour now supports alpha values.

This commit is contained in:
Twan van Laarhoven
2020-04-23 22:59:29 +02:00
parent 1fe145864e
commit 4258ce1c6c
25 changed files with 94 additions and 140 deletions
+4 -4
View File
@@ -112,7 +112,7 @@ SCRIPT_FUNCTION(to_int) {
if (t == SCRIPT_BOOL) {
result = (bool)*input ? 1 : 0;
} else if (t == SCRIPT_COLOR) {
AColor c = (AColor)*input;
Color c = (Color)*input;
result = (c.Red() + c.Blue() + c.Green()) / 3;
} else if (t == SCRIPT_STRING) {
long l;
@@ -141,7 +141,7 @@ SCRIPT_FUNCTION(to_real) {
if (t == SCRIPT_BOOL) {
result = (bool)*input ? 1.0 : 0.0;
} else if (t == SCRIPT_COLOR) {
AColor c = (AColor)*input;
Color c = (Color)*input;
result = (c.Red() + c.Blue() + c.Green()) / 3.0;
} else if (t == SCRIPT_STRING) {
String str = input->toString();
@@ -166,7 +166,7 @@ SCRIPT_FUNCTION(to_number) {
if (t == SCRIPT_BOOL) {
SCRIPT_RETURN((bool)*input ? 1 : 0);
} else if (t == SCRIPT_COLOR) {
AColor c = (AColor)*input;
Color c = (Color)*input;
SCRIPT_RETURN( (c.Red() + c.Blue() + c.Green()) / 3 );
} else if (t == SCRIPT_DOUBLE) {
SCRIPT_RETURN((double)*input);
@@ -208,7 +208,7 @@ SCRIPT_FUNCTION(to_boolean) {
SCRIPT_FUNCTION(to_color) {
try {
SCRIPT_PARAM_C(AColor, input);
SCRIPT_PARAM_C(Color, input);
SCRIPT_RETURN(input);
} catch (const ScriptError& e) {
return delay_error(e);
+1 -1
View File
@@ -44,7 +44,7 @@ SCRIPT_FUNCTION(new_card) {
} else if (PackageChoiceValue* pvalue = dynamic_cast<PackageChoiceValue*>(value)) {
pvalue->package_name = v->toString();
} else if (ColorValue* cvalue = dynamic_cast<ColorValue*>(value)) {
cvalue->value = (AColor)*v;
cvalue->value = (Color)*v;
} else {
throw ScriptError(format_string(_("Can not set value '%s', it is not of the right type"),name));
}