November 4th: Color Continued

Worked a lot more on the color thing today, and made a ColorChannel helper to help with my Color helper. I used an Haxe abstract to implement this, which is completely different from an abstract class in most other programming languages — basically, instead of a class with some methods unimplemented, designed to be extended, a Haxe abstract is a way of skinning over an existing type with new methods. This is kind of cool, since it lets me create a Color class which is still actually a UInt and can be used in all the same ways, but it’s also a pretty dangerous concept since it mixes basic types and Objects in a language where the former are always passed as parameters and the latter as references. There’s also a bunch of weird constraints on what you can do with abstracts. I may end up going back to implementing these as classes if it gets to be too much of a clusterfuck, but it’s fun to play around with at least for now.

Advertisements

About problemmachine

What is the nature of your problem? Can we modify the nature of your problem? Can your problem be touched? Eaten? May we eat your problem for you? May we eat your soul for you? Would you like a replacement problem? We make problems. We eat souls. We crap solutions. We are Problem Machine.
This entry was posted in Daily Update, Programming. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s