Advertisement
Peaser

rgb

Sep 29th, 2014
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. class rgb(object):
  2.     def __init__(self, r, g, b):
  3.         self.r = r
  4.         self.g = g
  5.         self.b = b
  6.         self.tuple = (r, g, b)
  7.         self.sum = sum(self.tuple)
  8.         self.max = max(self.tuple)
  9.         self.min = min(self.tuple)
  10.         self.average = self.sum/3
  11.  
  12.  
  13. a = rgb(22,41,15)
  14.  
  15. print a.average
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement