Changing Color of Text In Texbox with Python

1325
2
05-04-2012 04:31 PM
CharlesGant
New Contributor III
Is this possible?  I need to be able to dynamically change the color of text in a text rectangle with python.  I know I can use textelement.text to change the text, but can you use that somehow maybe with RGB values to change the color also?

Thanks
Tags (2)
0 Kudos
2 Replies
CharlesGant
New Contributor III
Nevermind.  I figured it out. 

elm.text = '<CLR red="25" green="55" blue="255">' + newtext + '</CLR>'
JeffBarrette
Esri Regular Contributor
That is great that you figured this out.  Using tags is really the only way to modify individual text properties on a layout.  At 10.1 we did add fontSize but that is it.

Jeff
0 Kudos