Hello;
I’ve created a class that handles colors. I’m posting it here in case someone’s interested.
But that’s not the purpose of my thread;
My question is: is there any way to create a new data type?
Here is the behavior I’m looking for:
[AS]
var color:yColor = new yColor()
color = 0xFF0000;
[/AS]
Basically, I want the = to act like a getter setter function.
Like the string, number, etc data type. Is there a way to do this?
I’d also like the yColor class, when used, to behave like a uint. Currently, you would have to do this:
[LEFT][AS]
someFunctionThatRequiresColor(color.color)
[/AS]
[/LEFT]
I want to be able to do simply this:
[AS]
someFunctionThatRequiresColor(color)
[/AS]
I tried extending the uint class, but it’s a final class.
So…any thoughs?
A bit off-subject, but might be handy some day, you’ll find attached our classes to handle color. They aren’t finished though. I plan to add a function to change the hue dynamically (animate it), as well as a few other ideas.