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

use rgba hexcodes not argb #196

Merged
merged 3 commits into from
Aug 15, 2024
Merged

use rgba hexcodes not argb #196

merged 3 commits into from
Aug 15, 2024

Conversation

bertt
Copy link
Member

@bertt bertt commented Aug 14, 2024

Previous behaviour: For parsing the hex color codes a ARGB pattern is assumed, with the alpha in the first two characters (in case the hex code is 8 characters)

1] For example: #55FF0000

Becomes Color red (255,0,0) + Alpha = 85

More commonly the RGBA is used:

2] For example #FF000055

Becomes Color red (255,0,0) + Alpha = 85

Fix: Assume the RGBA order not ARGB

@bertt bertt marked this pull request as draft August 14, 2024 19:23
@bertt bertt mentioned this pull request Aug 14, 2024
@bertt bertt marked this pull request as ready for review August 15, 2024 08:35
@bertt
Copy link
Member Author

bertt commented Aug 15, 2024

One improvement: dependency System.Drawing is now only used in two places

  • MaterialCreator.cs (and test MaterialCreatorTests)

  • RgbaColor.cs

It should be possible to remove System.Drawing completely, but that's for another PR.

@bertt bertt merged commit 1e71555 into master Aug 15, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant