<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Lable BASED on a features Color in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/lable-based-on-a-features-color/m-p/49027#M3880</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Cool idea Robert!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
def FindLabel ( [Label],&lt;R&gt;,&lt;G&gt;,&lt;B&gt;):
&amp;nbsp; s='&amp;lt;CLR red="'+str(&lt;R&gt;)+'" green="'+str(&lt;G&gt;)+'" blue="'+str(&lt;B&gt;)+'"&amp;gt;' #should return something like: &amp;lt;CLR red="255" green="00" blue="00'"&amp;gt;
&amp;nbsp; s+=[Lable]
&amp;nbsp; s+="&amp;lt;/CLR&amp;gt;"
&amp;nbsp; return s
&lt;/B&gt;&lt;/G&gt;&lt;/R&gt;&lt;/B&gt;&lt;/G&gt;&lt;/R&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:53:20 GMT</pubDate>
    <dc:creator>JoshuaChisholm</dc:creator>
    <dc:date>2021-12-10T21:53:20Z</dc:date>
    <item>
      <title>Lable BASED on a features Color</title>
      <link>https://community.esri.com/t5/python-questions/lable-based-on-a-features-color/m-p/49026#M3879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am looking for a script to use in a features label would label it with that features color.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In RGB&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 19:52:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/lable-based-on-a-features-color/m-p/49026#M3879</guid>
      <dc:creator>RobertBorchert</dc:creator>
      <dc:date>2014-04-02T19:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Lable BASED on a features Color</title>
      <link>https://community.esri.com/t5/python-questions/lable-based-on-a-features-color/m-p/49027#M3880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Cool idea Robert!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
def FindLabel ( [Label],&lt;R&gt;,&lt;G&gt;,&lt;B&gt;):
&amp;nbsp; s='&amp;lt;CLR red="'+str(&lt;R&gt;)+'" green="'+str(&lt;G&gt;)+'" blue="'+str(&lt;B&gt;)+'"&amp;gt;' #should return something like: &amp;lt;CLR red="255" green="00" blue="00'"&amp;gt;
&amp;nbsp; s+=[Lable]
&amp;nbsp; s+="&amp;lt;/CLR&amp;gt;"
&amp;nbsp; return s
&lt;/B&gt;&lt;/G&gt;&lt;/R&gt;&lt;/B&gt;&lt;/G&gt;&lt;/R&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:53:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/lable-based-on-a-features-color/m-p/49027#M3880</guid>
      <dc:creator>JoshuaChisholm</dc:creator>
      <dc:date>2021-12-10T21:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Lable BASED on a features Color</title>
      <link>https://community.esri.com/t5/python-questions/lable-based-on-a-features-color/m-p/49028#M3881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I know Python is the next logical step in my GIS progession.&amp;nbsp; But right now I am pretty ignorant.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried pasting the code into the the label expression (maplex)&amp;nbsp; it said it was a valid code no features found could not verify expression.&amp;nbsp; I don't have it set up with any definition queries and all features are showing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the ArcMap Drawing Errors window that popped up it then says &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;General Function Failure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Too few parameters.&amp;nbsp; Expected 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions on what I am doing wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or should I be using field calculator to fill a field with this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Cool idea Robert!&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
def FindLabel ( [Label],&lt;R&gt;,&lt;G&gt;,&lt;B&gt;):
&amp;nbsp; s='&amp;lt;CLR red="'+str(&lt;R&gt;)+'" green="'+str(&lt;G&gt;)+'" blue="'+str(&lt;B&gt;)+'"&amp;gt;' #should return something like: &amp;lt;CLR red="255" green="00" blue="00'"&amp;gt;
&amp;nbsp; s+=[Lable]
&amp;nbsp; s+="&amp;lt;/CLR&amp;gt;"
&amp;nbsp; return s
&lt;/B&gt;&lt;/G&gt;&lt;/R&gt;&lt;/B&gt;&lt;/G&gt;&lt;/R&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:53:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/lable-based-on-a-features-color/m-p/49028#M3881</guid>
      <dc:creator>RobertBorchert</dc:creator>
      <dc:date>2021-12-10T21:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Lable BASED on a features Color</title>
      <link>https://community.esri.com/t5/python-questions/lable-based-on-a-features-color/m-p/49029#M3882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Python is a great language, but this small script is a little complicated. We're trying to create a sting output with tags and quotes, so the python code gets pretty messy. Usually it's a little easy to follow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let's start with the basics. &lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;What does your data look like?&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Which field are trying to label?&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Which field(s) hold the RGB values? and how are they formatted?&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2014 15:28:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/lable-based-on-a-features-color/m-p/49029#M3882</guid>
      <dc:creator>JoshuaChisholm</dc:creator>
      <dc:date>2014-04-03T15:28:58Z</dc:date>
    </item>
  </channel>
</rss>

