} else if (value.startsWith("url(")) {
// refers to a gradient
} else {
- if (value.toLowerCase().equals("black")) {
+ if (value.toLowerCase().equals("transparent")) {
+ this.red = 0;
+ this.green = 0;
+ this.blue = 0;
+ this.alpha = 1;
+ } else {
+ boolean found = false;
+ for(int count = 0; count < names.length; count++) {
+ if (value.toLowerCase().equals(names[count])) {
+ this.red = vals[count][0] / 255f;
+ this.green = vals[count][1] / 255f;
+ this.blue = vals[count][2] / 255f;
+ found = true;
+ break;
+ }
+ }
+ if(!found) {
+ this.red = 0;
+ this.green = 0;
+ this.blue = 0;
+ MessageHandler.errorln("ERROR: unknown colour name: " + value);
+ }
+ }
+
+/* if (value.toLowerCase().equals("black")) {
this.red = 0;
this.green = 0;
this.blue = 0;
this.green = 0;
this.blue = 0;
MessageHandler.errorln("ERROR: unknown colour name: " + value);
- }
+ }*/
}
}
public float alpha() {
return this.alpha;
}
-}
-/*
- if (value.toLowerCase().equals("transparent")) {
- this.red = 0;
- this.green = 0;
- this.blue = 0;
- this.alpha = 1;
- } else {
- boolean found = false;
- for(int count = 0; count < names.length; count++) {
- if (value.toLowerCase().equals(names[count])) {
- this.red = vals[count][0] / 255f;
- this.green = vals[count][1] / 255f;
- this.blue = vals[count][2] / 255f;
- found = true;
- break;
- }
- }
- if(!found) {
- this.red = 0;
- this.green = 0;
- this.blue = 0;
- MessageHandler.errorln("ERROR: unknown colour name: " + value);
- }
- }
-
final static String[] names = {
"aliceblue",
{255, 255, 0},
{154, 205, 50}
};
-*/
+}
+
/*
aliceblue rgb(240, 248, 255)
antiquewhite rgb(250, 235, 215)