1

I have this label expression within a function that works great. I want to turn the color to white.

lblClass.expression = '"{}" + [OBJECTID] +  "{}"'.format("<FNT size = '10'>","</FNT>")

this the RGB colors for white...

<CLR red='255' green='255' blue='255'>

I am unsure on how to format this together

  • 1
    not tested but normally you can simply concatenate format("<CLR red='255' green='255' blue='255'><FNT size = '10'>","</FNT></CLR>") – radouxju May 31 '16 at 20:03
1

as @radouxju has said, you can link the different tags together:

lblClass.expression = '"{}" + [OBJECTID] +  "{}"'.format("<FNT size = '10'><CLR red='255' green='255' blue='255'>","</CLR></FNT>")

which should output something like <FNT size = '10'><CLR red='255' green='255' blue='255'>[OBJECTID]</CLR></FNT>

  • 1
    so the "<FNT size = '10'><CLR red='255' green='255' blue='255'>" opens the coloring and font tags? and then I have to close it with"</CLR></FNT>" ? like HTML style? – ziggy May 31 '16 at 20:19
  • yes, that's right – Midavalo May 31 '16 at 20:23
2

you just need to open and close your color tags in the expression

lblClass.expression = '"{}" + [OBJECTID] +  "{}"'.format("<CLR red = '255' green = '255' blue = '255'><FNT size = '10'>","</FNT></CLR>")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.