From: JazzyNico Date: Fri, 3 Sep 2010 20:13:47 +0000 (+0200) Subject: Extensions. UI consistency fixes and UI improvements (new help tabs when needed,... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8ee3cffe0979389ae4a2a85c491d25381719ee9e;p=inkscape.git Extensions. UI consistency fixes and UI improvements (new help tabs when needed, and new tooltips). --- diff --git a/share/extensions/color_custom.inx b/share/extensions/color_custom.inx index 78fd504aa..bb37f62ff 100644 --- a/share/extensions/color_custom.inx +++ b/share/extensions/color_custom.inx @@ -5,9 +5,22 @@ coloreffect.py color_custom.py simplestyle.py - r - g - b + + + r + g + b + + + <_param name="instructions" type="description" xml:space="preserve">Allows you to evaluate different functions for each channel. +r, g and b are the normalized values of the red, green and blue channels. The resulting RGB values are automatically clamped. + +Example (half the red, swap green and blue): + Red Function: r*0.5 + Green Function: b + Blue Function: g + + all diff --git a/share/extensions/color_custom.py b/share/extensions/color_custom.py index f2f8719db..a90102d0f 100644 --- a/share/extensions/color_custom.py +++ b/share/extensions/color_custom.py @@ -2,37 +2,50 @@ import coloreffect class C(coloreffect.ColorEffect): - def __init__(self): - coloreffect.ColorEffect.__init__(self) - self.OptionParser.add_option("--r", action="store", type="string", dest="rFunction", default="r",help="red channel function") - self.OptionParser.add_option("--g", action="store", type="string", dest="gFunction", default="g",help="green channel function") - self.OptionParser.add_option("--b", action="store", type="string", dest="bFunction", default="b",help="blue channel function") + def __init__(self): + coloreffect.ColorEffect.__init__(self) + self.OptionParser.add_option("--r", + action="store", type="string", + dest="rFunction", default="r", + help="red channel function") + self.OptionParser.add_option("--g", + action="store", type="string", + dest="gFunction", default="g", + help="green channel function") + self.OptionParser.add_option("--b", + action="store", type="string", + dest="bFunction", default="b", + help="blue channel function") + self.OptionParser.add_option("--tab", + action="store", type="string", + dest="tab", + help="The selected UI-tab when OK was pressed") - def normalize(self, v): - if v<0: - return 0.0 - if v>1: - return 1.0 - return v + def normalize(self, v): + if v<0: + return 0.0 + if v>1: + return 1.0 + return v - def _hexstr(self,r,g,b): - return '%02x%02x%02x' % (int(round(r*255)),int(round(g*255)),int(round(b*255))) - - def colmod(self,_r,_g,_b): - r=float(_r)/255 - g=float(_g)/255 - b=float(_b)/255 - - # add stuff to be accessible from within the custom color function here. - safeenv = {'__builtins__':{},'r':r,'g':g,'b':b} + def _hexstr(self,r,g,b): + return '%02x%02x%02x' % (int(round(r*255)),int(round(g*255)),int(round(b*255))) + + def colmod(self,_r,_g,_b): + r=float(_r)/255 + g=float(_g)/255 + b=float(_b)/255 + + # add stuff to be accessible from within the custom color function here. + safeenv = {'__builtins__':{},'r':r,'g':g,'b':b} - try: - r2=self.normalize(eval(self.options.rFunction,safeenv)) - g2=self.normalize(eval(self.options.gFunction,safeenv)) - b2=self.normalize(eval(self.options.bFunction,safeenv)) - except: - return self._hexstr(1.0,0.0,0.0) - return self._hexstr(r2,g2,b2) + try: + r2=self.normalize(eval(self.options.rFunction,safeenv)) + g2=self.normalize(eval(self.options.gFunction,safeenv)) + b2=self.normalize(eval(self.options.bFunction,safeenv)) + except: + return self._hexstr(1.0,0.0,0.0) + return self._hexstr(r2,g2,b2) c = C() c.affect() diff --git a/share/extensions/color_randomize.inx b/share/extensions/color_randomize.inx index 82691f0f4..8584722fa 100644 --- a/share/extensions/color_randomize.inx +++ b/share/extensions/color_randomize.inx @@ -7,9 +7,9 @@ simplestyle.py - true - true - true + true + true + true <_param name="instructions" type="description" xml:space="preserve">Converts to HSL, randomizes hue and/or saturation and/or lightness and converts it back to RGB. diff --git a/share/extensions/color_replace.inx b/share/extensions/color_replace.inx index f62b2a4e5..289c4424d 100644 --- a/share/extensions/color_replace.inx +++ b/share/extensions/color_replace.inx @@ -5,8 +5,8 @@ coloreffect.py color_replace.py simplestyle.py - 000000 - 000000 + 000000 + 000000 all diff --git a/src/extension/internal/bluredge.cpp b/src/extension/internal/bluredge.cpp index e32012070..a82c7ba77 100644 --- a/src/extension/internal/bluredge.cpp +++ b/src/extension/internal/bluredge.cpp @@ -133,8 +133,8 @@ BlurEdge::init (void) "\n" "" N_("Inset/Outset Halo") "\n" "org.inkscape.effect.bluredge\n" - "1.0\n" - "11\n" + "1.0\n" + "11\n" "\n" "all\n" "\n"