Skip to content

Instantly share code, notes, and snippets.

@chhantyal
Created February 25, 2013 19:50
Show Gist options
  • Save chhantyal/5032646 to your computer and use it in GitHub Desktop.
Save chhantyal/5032646 to your computer and use it in GitHub Desktop.
A python constructor.
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