2.14.3 colors

Brief Information

Open the colors dialog that allow the color picker button to get screen pixel color.

Additional Information

X-Function not designed for Auto GetN Dialog.

Command Line Usage

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

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
out

Output

int

<unassigned>
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.
print

Input

int

0
Specify whether to output the HTML standard color code for the selected color. Option list:
  • 0
do not output the HTML color.
  • 1
output the HTML color.
init

Input/Output

int

2
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.

Description

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.

Examples

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;