これらの定数から以下の Set fontcolor 関数に色を渡そうとしていますが、GIMP ダイアログから直接渡さない限り、毎回「色名を解析できません」というメッセージが表示されます。直接渡される変数をログに記録しました.2番の値はログからの直接コピーです. ここで私が間違っていることや欠けていることを誰でも見ることができますか。ありがとう
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()