Advertisement
Loadus

Inkscape - Linearize effect

Apr 3rd, 2011
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 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 = pow(r, 0.45)
  10.     g = pow(g, 0.45)
  11.     b = pow(b, 0.45)
  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