Page 1 of 1

convert vpi color to string

Posted: 25 Jun 2023 21:58
by drspro2
when i Insert a vip color through the insert-menu in the editor i get for example this color:

0xB3B3FF

after that i would like to have this color to a string like "0xB3B3FF",

but when i use: toString( 0xB3B3FF ) the result of that is "11777023"

but i would like to have "0xB3B3FF" is there a way to realize that?


thankyou

Re: convert vpi color to string

Posted: 26 Jun 2023 8:17
by Thomas Linder Puls
The very short answer:

Code: Select all

        ColorHex = string::format("0x%06x", 0xB3B3FF),
You can find more on format strings (which are also used by outputStream::writef) here: Language_Reference/Domains#Format_Strings.

Re: convert vpi color to string

Posted: 26 Jun 2023 14:22
by drspro2
thankyou , it works