<?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 The method of mapping the color on the attribute from 0-255 to 0-1 and converting RGB color to HSL color in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/the-method-of-mapping-the-color-on-the-attribute/m-p/1688597#M11613</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to apply object-level RGB color data to building/facade rules, but I am encountering syntax errors related to attribute declaration and array usage.&lt;/P&gt;&lt;P&gt;Current situation:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;I defined a custom attribute to store color data as numeric RGB values.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The attribute is intended to represent a 3-component color (values in 0–255).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;I attempted to use array indexing (e.g., attr color = [255,255,255] and color[0]) to convert it into normalized RGB for use in the color() function.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Issues observed:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Declaring the attribute as a numeric array sometimes results in compilation errors.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Using indexed access on the attribute inside rule functions causes syntax errors.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The rule engine compiles only when the attribute is treated as a simple type (e.g., string or scalar).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Additionally:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;I also attempted to convert RGB values to HSL for conditional styling, which further increased syntax complexity.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Questions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;What is the correct way to define and use multi-component numeric attributes in CGA?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Are fixed-length numeric arrays supported as attribute types?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;If not, what is the recommended alternative for storing RGB values at the object level without causing syntax errors?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;How should RGB → HSL conversion be implemented safely inside CGA rules?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The main problem appears to be related to attribute typing and syntax restrictions rather than the color conversion logic itself.&lt;/P&gt;&lt;P&gt;Any guidance on correct attribute definitions and color conversion handling would be appreciated.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2026 03:07:13 GMT</pubDate>
    <dc:creator>biaozeng</dc:creator>
    <dc:date>2026-03-05T03:07:13Z</dc:date>
    <item>
      <title>The method of mapping the color on the attribute from 0-255 to 0-1 and converting RGB color to HSL color</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/the-method-of-mapping-the-color-on-the-attribute/m-p/1688597#M11613</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to apply object-level RGB color data to building/facade rules, but I am encountering syntax errors related to attribute declaration and array usage.&lt;/P&gt;&lt;P&gt;Current situation:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;I defined a custom attribute to store color data as numeric RGB values.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The attribute is intended to represent a 3-component color (values in 0–255).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;I attempted to use array indexing (e.g., attr color = [255,255,255] and color[0]) to convert it into normalized RGB for use in the color() function.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Issues observed:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Declaring the attribute as a numeric array sometimes results in compilation errors.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Using indexed access on the attribute inside rule functions causes syntax errors.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The rule engine compiles only when the attribute is treated as a simple type (e.g., string or scalar).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Additionally:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;I also attempted to convert RGB values to HSL for conditional styling, which further increased syntax complexity.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Questions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;What is the correct way to define and use multi-component numeric attributes in CGA?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Are fixed-length numeric arrays supported as attribute types?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;If not, what is the recommended alternative for storing RGB values at the object level without causing syntax errors?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;How should RGB → HSL conversion be implemented safely inside CGA rules?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The main problem appears to be related to attribute typing and syntax restrictions rather than the color conversion logic itself.&lt;/P&gt;&lt;P&gt;Any guidance on correct attribute definitions and color conversion handling would be appreciated.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2026 03:07:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/the-method-of-mapping-the-color-on-the-attribute/m-p/1688597#M11613</guid>
      <dc:creator>biaozeng</dc:creator>
      <dc:date>2026-03-05T03:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: The method of mapping the color on the attribute from 0-255 to 0-1 and converting RGB color to HSL color</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/the-method-of-mapping-the-color-on-the-attribute/m-p/1688615#M11614</link>
      <description>&lt;P&gt;Solved through AI&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2026 07:33:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/the-method-of-mapping-the-color-on-the-attribute/m-p/1688615#M11614</guid>
      <dc:creator>biaozeng</dc:creator>
      <dc:date>2026-03-05T07:33:34Z</dc:date>
    </item>
  </channel>
</rss>

