# Using Color Prototypes

**URL:** https://forum.kirupa.com/t/using-color-prototypes/216131
**Category:** flash
**Created:** [February 13, 2007, 11:57pm UTC](https://forum.kirupa.com/t/using-color-prototypes/216131 "2007-02-13T23:57:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![theSchtickler](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@theSchtickler](https://forum.kirupa.com/u/theSchtickler)
#### Post date: [February 13, 2007, 11:57pm UTC](https://forum.kirupa.com/t/using-color-prototypes/216131/1 "2007-02-13T23:57:18Z")

</div>

Hey there,

So I only found out what prototypes are this morning! And I got a couple working, but I can’t work out how to apply this one from robertpenner.

[AS]//tint an object with a color just like Effect panel  
//r, g, b between 0 and 255; amount between 0 and 100  
Color.prototype.setTint = function (r, g, b, amount) {  
var percent = 100 - amount;  
var trans = new Object();  
trans.ra = trans.ga = trans.ba = percent;  
var ratio = amount / 100;  
trans.rb = r \* ratio;  
trans.gb = g \* ratio;  
trans.bb = b \* ratio;  
this.setTransform(trans);  
}//Robert Penner June 2001 - [www.robertpenner.com](http://www.robertpenner.com)  
[/AS]

I have tried;  
myMC.Color.setTint(120,0,0,60);  
and also  
myMC.color.setTint(120,0,0,60);  
but neither work

Can anyone help?

Thanks 🙂
