PluginColorString.py

branch
eric7
changeset 51
c02cbedf626d
parent 48
e35a2acef5b8
child 55
43b616631f94
equal deleted inserted replaced
50:0b70eb0b9145 51:c02cbedf626d
20 # Start-Of-Header 20 # Start-Of-Header
21 name = "Color String Plug-in" 21 name = "Color String Plug-in"
22 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 22 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
23 autoactivate = True 23 autoactivate = True
24 deactivateable = True 24 deactivateable = True
25 version = "1.0.0" 25 version = "10.0.0"
26 className = "ColorStringPlugin" 26 className = "ColorStringPlugin"
27 packageName = "ColorString" 27 packageName = "ColorString"
28 shortDescription = "Insert color as string" 28 shortDescription = "Insert color as string"
29 longDescription = ( 29 longDescription = (
30 """This plug-in implements a tool to select a color via a""" 30 """This plug-in implements a tool to select a color via a"""
392 if len(parts) not in [3, 4]: 392 if len(parts) not in [3, 4]:
393 return False, [] 393 return False, []
394 394
395 for part in parts: 395 for part in parts:
396 try: 396 try:
397 c = int(part) 397 c = int(float(part)) if "." in part else int(part)
398 except ValueError: 398 except ValueError:
399 return False, [] 399 return False, []
400 400
401 if c < 0 or c > 255: 401 if c < 0 or c > 255:
402 return False, [] 402 return False, []

eric ide

mercurial