Open the colors dialog that allow the color picker button to get screen pixel color.
X-Function not designed for Auto GetN Dialog.
1. int result;colors result;result=;
2. colors p:=1;
3. colors p:=1 i:=color(#1F4DB4);
4. colors v1 i:=color(#1F4DB4); //result is in v1
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
out |
Output int |
|
Specify the selected color to be output to. The output color code is OCOLOR value, an internal color code. You can use ocolor2rgb function to convert ocolor value to RGB value. | |
Input int |
|
Specify whether to output the HTML standard color code for the selected color. Option list:
| ||
init |
Input/Output int |
|
Specify the initial color when the Color dialog is opened. OCOLOR value and color index (for build-in color only) is supported. You can use color function to convert RGB value to ocolor value. |
This function is used to Open the colors dialog that allow the color picker button to get screen pixel color. You can also select color by specifying RGB or HSL values.
Ex 1
The following codes open the Color dialog with Purple as default color, and you can then select a color and print that color in both OCOLOR value and RGB value.
colors out:=v1 init:=10; v1=; ocolor2rgb(v1)=;
Ex 2
Assume a graph with scatter plot is active. Run the following code to pick a color from screen and set this color to scatter symbols.
colors v1; set %C -c v1;