Cross Reference: color_lesssaturation.py
xref
: /
inkscape
/
share
/
extensions
/
color_lesssaturation.py
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
#!/
usr
/
bin
/
env
python
import
coloreffect
,
inkex
class
C(
coloreffect
.
ColorEffect
):
def
colmod
(
self
,r,g,b):
hsl
=
self
.
rgb_to_hsl
(r/
255.0
, g/
255.0
, b/
255.0
)
#inkex.debug("hsl: " + str(hsl[0]) + ", " + str(hsl[1]) + ", " + str(hsl[2]))
hsl
[
1
] =
hsl
[
1
] -
0.05
if
hsl
[
1
] <
0.0
:
hsl
[
1
] =
0.0
rgb
=
self
.
hsl_to_rgb
(
hsl
[
0
],
hsl
[
1
],
hsl
[
2
])
return
'%02x%02x%02x'
% (
rgb
[
0
]*
255
,
rgb
[
1
]*
255
,
rgb
[
2
]*
255
)
c = C()
c.
affect
()