Fix incorrect blue color on radar for diwako_dui_colors >> tritanomaly #193
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using the tritanomaly color scheme the blue icon on the radar is colored differently than the blue text. If you assign a unit to the blue team and get the compass color assigned to the unit (
_unit getVariable "diwako_dui_main_compass_color"
) it returns[0.2,0.411765,-0.0235294]
.The blue config hex value for
diwako_dui_colors >> tritanomaly
contains a lowercase 'd'. This causes an issue with_getColorFromHex
when converting from hex to an RGB value in the range of [0, 1] because the function expects the incoming hex string to only have values 0-9 or A-F. The 'd' cannot be found in_nums
and thus_b = -1 * 16 + 10 == -6
, and then divided by 255 to produce the value -0.0235294. The negative value is then treated as zero when used bydrawIcon3D
.These changes fix the aforementioned config value and adds
toUpper
to_getColorFromHex
, in case a lowercase letter slips into another hex value in the future.