Color struct QOL tweak: Preview the built-in colors in-editor#28
Color struct QOL tweak: Preview the built-in colors in-editor#28Demorome wants to merge 23 commits intoMoonsideGames:mainfrom
Conversation
thatcosmonaut
left a comment
There was a problem hiding this comment.
Overall this is reasonable, just some nitpicks.
…n concerns and limited use-cases
…ry's superior implementation
|
This is looking good, I'm going to try to split this into a content and a formatting commit. |
|
Should we just remove PackedValue()? It's a pretty bad gotcha. EDIT: I guess it's useful for ImGui interop... |
|
I was going to rename it to UnsafePackedValue, at the very least. |
|
Then let's remove it. |
|
Huh, apparently using |
|
I've removed I've also added Otherwise, the other changes were pretty minor. |
Since "byte-order" has confusing implications with endianness.
|
I was thinking of adding unit tests for these functions, using something like https://code.visualstudio.com/docs/csharp/testing, but I felt that adding a whole new project just for this PR would be a bit out of scope. Lemme know if you feel otherwise. I would probably be using xUnit, since that seems to be the most popular. It would look like: https://xunit.net/docs/getting-started/v3/getting-started |
The rest is pretty minor:
StructLayoutto guarantee it'll be 32-bit packed (probably paranoid).FromPacked()static constructor.ToHexString()method.#regionat the bottom.byte-overloaded ctor for built-in colors since it has less operations (extremely minor, but while I'm here...).namespace MoonWorks.Graphics;declaration instead of a scoped declaration to save horizontal viewing space.