Advertisement
Loadus

Inkscape - Vintage Colour effects

Apr 4th, 2011
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. import coloreffect
  2. import math
  3.  
  4. class C(coloreffect.ColorEffect):
  5.   def colmod(self,r,g,b):
  6.     r = float(r) / 255
  7.     g = float(g) / 255
  8.     b = float(b) / 255
  9.     r = r * 0.75 + g * 0.25
  10.     g = g * 0.75 + b * 0.25
  11.     b = b * 0.75 + b * 0.25
  12.     r = int(r * 255)
  13.     g = int(g * 255)
  14.     b = int(b * 255)
  15.     return '%02x%02x%02x' % (r,g,b)
  16.  
  17. c = C()
  18. c.affect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement