Bug - Not A Bug r11967: print(string, "orange") in ASH doesn't work

Vandermonde

New member
Title says it all.

More specifically, unrecognised colors are treated as black. I know there are things like LightGoldenRodYellow, but this was kind of surprising.
 

slyz

Developer
I'm not sure why it doesn't work, but here is a workaround:
PHP:
print( "TEST", "#FFA500" );
 

Theraze

Active member
Anything put into the "color" bit gets directly transferred to font color=. This can be validated in RuntimeLibrary.

According to http://www.tedmontgomery.com/tutorial/colors.html Orange should be FFA000, not FFA500. When I tested it in the gCLI, there was no # required. I suppose it depends how light you want your text to be. :) Sidenote. :)

Not sure why the mafia HTML parser skips orange, but... that's apparently the core of this bug. If it's actually a bug... possible that at that point, Java's colour parser didn't have an orange in it. Regarding the rest of it and black and so on, non-html colours not existing isn't a mafia bug.

Edit: Does appear that it's not a mafia bug. Aqua is a valid colour through the colour picker. It's not found in mafia's source except as it ties into items... nowhere does that colour get defined. Making this a limitation of Java, not a mafia bug.
 
Last edited:

lostcalpolydude

Developer
Staff member
I know it takes color codes; it's just that it's a pain to replace all of them.

Using the replace all feature of your text editor is a pain? You could even define the color to a variable, then use that variable everywhere. That would make it trivial to change in the future if you decide that you don't actually want orange after all.
 

Vandermonde

New member
I have lots of scripts and probably more suspect colors. You're probably right, though; it shouldn't be too bad once I actually do it.
 
Last edited:

Veracity

Developer
Staff member
Does appear that it's not a mafia bug. Aqua is a valid colour through the colour picker. It's not found in mafia's source except as it ties into items... nowhere does that colour get defined. Making this a limitation of Java, not a mafia bug.
Exactly. When you want to print in a color, KoLmafia wraps the string in a "<font color=xxx>" and "</font>" HTML directive and hands it off to Java to deal with.
 

Vandermonde

New member
Java
8jhxmdr.gif
 

Attachments

  • 8jhxmdr.gif
    8jhxmdr.gif
    286 bytes · Views: 86
Top