# New data type

**URL:** https://forum.kirupa.com/t/new-data-type/277387
**Category:** Uncategorized
**Created:** [December 11, 2008, 1:18pm UTC](https://forum.kirupa.com/t/new-data-type/277387 "2008-12-11T13:18:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Xannax](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/xannax/32/3350_2.png) [@Xannax](https://forum.kirupa.com/u/Xannax)
#### Post date: [December 11, 2008, 1:18pm UTC](https://forum.kirupa.com/t/new-data-type/277387/1 "2008-12-11T13:18:25Z")

</div>

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.
