I am trying to pass colors from these constants to to the Set fontcolor function below but everytime I do I get "unable to parse color name" unless I pass it directly from a GIMP Dialog. I even logged the variables being passed in directly, the value from number 2 is a direct copy from the log. Can anyone see what I am doing wrong or missing here. Thanks
FontGREEN1 = '(RGB(0,255,0,))'
FontGREEN2 = 'RGB (0.0, 1.0, 0.0, 1.0)'
#This causes the error
def setColor1 ( txtlayer, color):
color = FontGREEN1
pdb.gimp_text_layer_set_color(txtlayer, color)
#This causes the error
def setColor2 ( txtlayer ):
color = FontGREEN2
pdb.gimp_text_layer_set_color(txtlayer, color)
#this work fine, color passed directly from GIMP Dialog
def setColor3 ( txtlayer, color):
pdb.gimp_text_layer_set_color(txtlayer, color)
def setTextColor (img, drw, color ):
txtlayer = img.active_layer
setColor3(txtlayer, color)
register(
'setTextColor',
'Changes the color of the text with python',
'Changes the color of the text with python',
'RS',
'(cc)',
'2014',
'<Image>/File/Change Text Color...',
'', # imagetypes
[
(PF_COLOR,"normal_color","Green Color of the Normal Font",(0,234,0) ),
], # Parameters
[], # Results
setTextColor)
main()