ID:2724409
 
Resolved
The red and blue channels of atom.color were sometimes swapped when the color was applied to maptext, in specific situations.
BYOND Version:514
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 94.0.4606.71
Applies to:Dream Seeker
Status: Resolved (514.1569)

This issue has been resolved.
Descriptive Problem Summary:

The red and blue channels are swapped when applied to maptext. Because DX is stupid and uses BGR instead of RGB.

Numbered Steps to Reproduce Problem:

Code Snippet (if applicable) to Reproduce Problem:
maptext = "<font color=white>Test</font>
color = "red" // Results in blue "Test"
color = "blue" // Results in red "Test"


Expected Results:

The colors to match.

Actual Results:

Sad face, they do not. Green is fine though, because green is obviously the most superior color.



I find that this happens only when the atom's icon is null.

At first I couldn't reproduce it because my test project sets /atom/icon to one with primitive shapes, but setting icon back to null shows the bug.

A simple test project is just this (but you'll need to toggle text mode on and off to see the maptext):
world
maxx = 2

New()
new/obj/red(locate(1, 1, 1))
new/obj/blue(locate(2, 1, 1))

obj/red
maptext = "<font color=white>red"
color = "red"

obj/blue
maptext = "<font color=white>blue"
color = "blue"
Ah, so it does! Making it a single pixel icon is a good workaround.
In response to James
You can even give it an empty icon. Doesn't even need any icon states or visible pixels. Just not null.
Yeah, I gave it a 1x1 blank icon with no states. Worked like a charm.
Lummox JR resolved issue with message:
The red and blue channels of atom.color were sometimes swapped when the color was applied to maptext, in specific situations.