Any way that "DzColorWgt" initially displays a given color and not only white? [Solved]

V3DigitimesV3Digitimes Posts: 3,051

Good morning,

I try to set a given initial color to DzColorWgt, but it seems that I only can start from white (255 255 255).

Does any one know if there is a way to start from another color?

Thanks!

Post edited by V3Digitimes on

Comments

  • Richard HaseltineRichard Haseltine Posts: 96,920
    edited September 2015

    Does setting DzColorWgt.value = colour not work? I just tested (and forgot to copy the code before closing DS) and

    myColorWgt.value = new Color( 128, 128, 128);

    gave the expected result.

    Post edited by Richard Haseltine on
  • Does setting DzColorWgt.value = colour not work? I just tested (and forgot to copy the code before closing DS) and

    myColorWgt.value = new Color( 128, 128, 128);

    gave the expected result.

    Thank you Richard !!! It works.

    I did not think I could write ".value" with a widget too... Ok, next time I have a doubt I will try a ".value", since this is not the first time the answer is as simple as a ".value". I set the subject status as "solved" ;)

     

  • rbtwhizrbtwhiz Posts: 2,181

    Not all widgets provide the same APIs, so it is not safe to assume that the value property will exist on just any widget.  The value property is provided specifically by the DzColorWgt object.

    -Rob

  • Thanks Rob. I went to this page several times today, but I understood it wrong. The page is fine no worry. But with my own english language and scripting language limitations, instead of using DzColorWgt.value I was trying to use DzColorWgt.Color. I did it the wrong way. And of course it did not work.

    Now it is solved, and it works great! I'm so happy to see everything possible with scripting.

Sign In or Register to comment.