Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect blue color on radar for diwako_dui_colors >> tritanomaly #193

Merged
merged 1 commit into from
May 27, 2021
Merged

Fix incorrect blue color on radar for diwako_dui_colors >> tritanomaly #193

merged 1 commit into from
May 27, 2021

Conversation

pennyworth12345
Copy link
Contributor

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 by drawIcon3D.

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.

@diwako diwako added the bug Something isn't working label May 22, 2021
@diwako diwako added this to the 1.9.2 milestone May 22, 2021
@diwako
Copy link
Owner

diwako commented May 22, 2021

Oh that is a good catch

@diwako diwako merged commit 3e3a0cb into diwako:master May 27, 2021
@jokoho48 jokoho48 added bugfix and removed bug Something isn't working labels May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants