REALbasic: ColourTinting class
Posted on February 19, 2004
Filed Under /dev/null/ | 70 views |
Matthias Buercher posted the following sepia-tinting function on the MonkeyBread plug-in mailing list:
function sepia(c as color) as color
dim gray as integergray = 0.3*c.red + 0.59*c.green + 0.11*c.blue
return rgb(gray*235/255,gray*75/255,gray*20)
end function
His function hard-codes the grey value and the tint value to provide a sepia look. I decided to have some fun with it and extend it a bit into a generic colour tinting class. Takes a base grey colour, a base tint colour, and an image and returns a tinted picture.
REALbasic source code: ColourTinter.sit
Comments
Leave a Reply