Created
February 25, 2013 19:50
-
-
Save chhantyal/5032646 to your computer and use it in GitHub Desktop.
A python constructor.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Color(object): | |
'''An RGB color, with red, green and blue components.''' | |
def __init__(self, r, g, b): | |
'''A new color with red value r, green value g, and blue value b. All components are integers in the range 0-255.''' | |
self.red = r | |
self.green = g | |
self.blue = b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment