~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/share/extensions/color_lesssaturation.py

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import coloreffect, inkex
 
2
 
 
3
class C(coloreffect.ColorEffect):
 
4
  def colmod(self,r,g,b):
 
5
    hsl = self.rgb_to_hsl(r/255.0, g/255.0, b/255.0)
 
6
    #inkex.debug("hsl: " + str(hsl[0]) + ", " + str(hsl[1]) + ", " + str(hsl[2]))
 
7
    hsl[1] = hsl[1] - 0.05
 
8
    if hsl[1] < 0.0:
 
9
        hsl[1] = 0.0
 
10
    rgb = self.hsl_to_rgb(hsl[0], hsl[1], hsl[2])
 
11
    return '%02x%02x%02x' % (rgb[0]*255, rgb[1]*255, rgb[2]*255)
 
12
 
 
13
c = C()
 
14
c.affect()