Page 1 of 1

Color Type and visibility

PostPosted: Mon Jan 09, 2017 10:49 pm
by maccalder
Hi All

Got a couple of questions. .FillColor - if I am trying to assign a new fill color to an item, how does it expect the RGB value to be represented? If I set it to automatically apply changes in the properties panel and change the value, I can see the original value represented as 'rrr, ggg, bbb' which I tried - I also tried "0,255,0", "#00FF00", "00FF00" to no avail - I also tried dumping an existing fill color to a variable but got type-mismatch errors.

Also .Visible - toggling between 0 and 1 works fine on shapes, but does not seem to work on custom script buttons, drop down boxes, XY boxes etc? DOes not seem to work toggling it in the properties window either.

Regards

-Mac

PC: Xeon E3-1225 @ 3.3GHz, 8gb RAM, Windows 10 Enterprise LTSB, WD6 4242-RC

Re: Color Type and visibility

PostPosted: Thu Feb 09, 2017 1:48 pm
by Janina Baltaziewicz
Hi,

Sorry for the late reply.

Boolean data types require the value "true" or "false", 0 and 1 are not supposed to work properly here and also didn't work when I tested the ".Visible" member for some widgets, Shape included.
I also can't reproduce the issue with the check box in the item properties dialog, they all seem to work well despite the widget used.


There also is an new data type, called "Color", it has its own structure like a string or a double.
It is not yet fully implemented in revision 4242 but will be in the next release candidate. You will then also be able to create color-type global variables, editable via hex code.
There are several object properties that already use this data type, like .FillColor, .ForeColor, .LineColor, etc.
So if you want to have a look at this feature, try e.g. a ColorPicker and use the ColorPicker1.SelectedColor for a color value:

Shape1.FillColor = ColorPicker1.SelectedColor


Lokal variables also already support this type:

var x = ColorPicker1.SelectedColor
Shape1.FillColor = x


You can also use additional color members:
Shape1.FillColor.SetRGB(128,0,255)


Also (just one more), will the string members be updated in future, so that you can use something like this:
Shape1.FillColor = "#00FF00".ToColor