21 # Start-Of-Header |
19 # Start-Of-Header |
22 name = "Color String Plug-in" |
20 name = "Color String Plug-in" |
23 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
21 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
24 autoactivate = True |
22 autoactivate = True |
25 deactivateable = True |
23 deactivateable = True |
26 version = "2.2.3" |
24 version = "3.0.0" |
27 className = "ColorStringPlugin" |
25 className = "ColorStringPlugin" |
28 packageName = "ColorString" |
26 packageName = "ColorString" |
29 shortDescription = "Insert color as string" |
27 shortDescription = "Insert color as string" |
30 longDescription = \ |
28 longDescription = ( |
31 """This plug-in implements a tool to select a color via a""" \ |
29 """This plug-in implements a tool to select a color via a""" |
32 """ color selection dialog and insert it as a hex string at the""" \ |
30 """ color selection dialog and insert it as a hex string at the""" |
33 """ current cursor position. Selected text is used to initialize""" \ |
31 """ current cursor position. Selected text is used to initialize""" |
34 """ the dialog and is replaced with the new color.""" |
32 """ the dialog and is replaced with the new color.""" |
|
33 ) |
35 needsRestart = False |
34 needsRestart = False |
36 pyqtApi = 2 |
35 pyqtApi = 2 |
37 python2Compatible = True |
|
38 # End-Of-Header |
36 # End-Of-Header |
39 |
37 |
40 error = "" |
38 error = "" |
41 |
39 |
42 |
40 |
219 Private method to check, if a given text is a hex string. |
217 Private method to check, if a given text is a hex string. |
220 |
218 |
221 @param text text to check (string) |
219 @param text text to check (string) |
222 @return flag indicating a hex string (boolean) |
220 @return flag indicating a hex string (boolean) |
223 """ |
221 """ |
224 isHex = True |
222 return all(map(lambda c: c in "0123456789abcdefABCDEF", text)) |
225 for c in text: |
|
226 isHex = isHex and c in "0123456789abcdefABCDEF" |
|
227 return isHex |
|
228 |
223 |
229 def __isValidColor(self, name): |
224 def __isValidColor(self, name): |
230 """ |
225 """ |
231 Private method to check for a valid color name. |
226 Private method to check for a valid color name. |
232 |
227 |