Getting Color class properties

I try to retrieve the values of the red, green and blue properties of a Color class but that leads to a hard crash. I’m probably wrong somewhere but where ? In the same plugin retrieving properties value of Rect and other classes works fine. My skills are a bit limited but it seems that the Color class reference passed to RGBColorSetter is wrong

{"", "RGBColor", "Color", REALconsoleSafe, (REALproc)RGBColorGetter, (REALproc)RGBColorSetter},

static void RGBColorSetter(REALobject instance, long param, REALobject rgb)
    pRGBColor color;
    RBColor value;
    ClassData(PagePDF_Definition, instance, PagePDF_Data, me); 
    if (!REALGetPropValueColor(rgb, "Red", &value))

Var c1 As Color = Color.Brown
shape.RGBColor = c

a Color is just an UInt32 and you get the parameters by looking on the bits inside.

So there is no red property to load, since it is not an object.

Just discovered Color is not a class but a module.

Thanks Christian.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.