Hi,
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.
Current situation:
I defined a custom attribute to store color data as numeric RGB values.
The attribute is intended to represent a 3-component color (values in 0–255).
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.
Issues observed:
Declaring the attribute as a numeric array sometimes results in compilation errors.
Using indexed access on the attribute inside rule functions causes syntax errors.
The rule engine compiles only when the attribute is treated as a simple type (e.g., string or scalar).
Additionally:
I also attempted to convert RGB values to HSL for conditional styling, which further increased syntax complexity.
Questions:
What is the correct way to define and use multi-component numeric attributes in CGA?
Are fixed-length numeric arrays supported as attribute types?
If not, what is the recommended alternative for storing RGB values at the object level without causing syntax errors?
How should RGB → HSL conversion be implemented safely inside CGA rules?
The main problem appears to be related to attribute typing and syntax restrictions rather than the color conversion logic itself.
Any guidance on correct attribute definitions and color conversion handling would be appreciated.
Thank you.
Solved! Go to Solution.
Solved through AI
Solved through AI