Page 1 of 1

Requesting 3 new lines

Posted: Dec 17th, '15, 21:47
by mguzdial
I request the addition of four lines to Colors.gp -- creating getRed, getGreen, getBlue, and getAlpha as synonyms for r, g, and b in color. (I don't really need getAlpha, but it seems like a natural.)

Code: Select all

// Color

defineClass Color r g b a

method red Color { return r }
method green Color { return g }
method blue Color { return b }
method alpha Color { return a }
method getRed Color { return r }
method getGreen Color { return g }
method getBlue Color { return b }
method getAlpha Color { return a }
The reason is so that I can do this:
green-of-color.png
green-of-color.png (3.08 KiB) Viewed 10454 times
I can use getRed/green/blue to work with either pixels or colors. Yay, polymorphism!

Re: Requesting 3 new lines

Posted: Dec 28th, '15, 19:05
by JohnM
Sure! Will add in next release.