Color Picker
The Color Picker collects coordinates, colors, and regions from device screenshots or images. For a first pass, aim for a simple task: open a screenshot, click one target point, and copy its coordinate and color into your script.
Open the Color Picker and an Image
Common entry points:
- Open
Sample Workbenchfrom the main tool or action entry. It opens on theColor Pickerpage by default. - Right-click a device in the device list and choose
Capture Screenshot and Open in Color Picker. - Capture a screenshot from a remote control panel and open it in the Color Picker.
- From the File Manager or a project image preview, click
Open in Color Picker. - Open Sample Workbench first, then drag a local image onto the canvas area, or paste an image from the clipboard while the workbench is active.
The Sample Workbench can keep multiple image tabs open at the same time. When working across several screenshots, switch tabs, drag them to reorder, or close the ones you no longer need.
Record One Point
- After opening an image, zoom with the mouse wheel and drag the image so the target is easy to click.
- Move the pointer over the image. The magnifier shows the current coordinate and color.
- Click the target point. The point is added to the
Point List. - In the
Point List, review the coordinate and color value, then copy them into your script. - To pin several frequently used points, use
Color Records. While the pointer is over the image, press1to5to write into a record slot.
Random Sampling automatically generates multiple color points inside a region, which is useful for multi-point color checks. Code Templates turn the collected points, colors, or regions into script snippets that you can copy and then adjust in your script.
Select a Region and Save a Small Image
When a script needs to recognize a small image region:
- Hold
Shiftand drag to create a normal selection. - If you need a second region, hold
Meta/Ctrland drag. - In
Code Templates, clickSave Region Image. - Enter a file name.
- Choose where to save it:
Small Image Save Path,Project Path /res/, orDownload. - Click
Copy Code and Save Image.
This saves the region image and copies the related code to the clipboard. Paste the code where your script needs to find or load that small image.
The Save Region Image Template is stored separately from the bitmap image template. It supports the file-name variable $imgFileBaseName and every Color Picker code-template variable:
- Points and records:
$pointInitList,$pointList,$recordInitList,$recordList,$point[n].x,$point[n].y,$point[n].c,$record[n].x,$record[n].y, and$record[n].c. - Coordinate bounds:
$xMin,$yMin,$xMax,$yMax,$xFirst, and$yFirst. - Selections:
$shiftRect.left,$shiftRect.top,$shiftRect.right,$shiftRect.bottom,$metaRect.left,$metaRect.top,$metaRect.right, and$metaRect.bottom. - Selection image data:
$shiftRectImgDataand$metaRectImgData.
Test templates on a device
Set the current development test device in the text editor or from the device context menu, then click “Test on device” immediately to the left of Copy. The color picker supports five templates, find_image, load_data, and region images; the matrix tool supports six templates and matrix images. Both tools use the current development test device and follow changes to it immediately. Screenshot devices and device-list or group selections do not change the test target. If no current device is set or it is unavailable, set an available device through the same entry points first.
Use the pencil beside a color template title to edit its name, original code, test wrapper, and previews. Matrix templates use the existing editor. Changes save automatically, including when closing with Escape. An empty name for templates 1–5 uses the current language’s default. An empty test wrapper disables testing. Reset restores the corresponding name, original code, and wrapper together.
$code inserts the generated original code without expanding its contents again. $screenOrient is the screenshot orientation, defaulting to 0; matrix templates also support $coreLine. Image tests support $testResourceRoot and $testImagePath and can send the current PNG directly without saving it locally first.
Testing opens the editor’s device log panel and preserves files, existing logs, and workbench content. Code is sent after the log connection is ready. Results and errors appear in device logs. Finish an active device script or editor run/debug task first. If dispatch is unconfirmed, check the logs before retrying.
Common Issues
- Screenshot failed: confirm that the device is online, licensed, and able to capture screenshots.
- Paste did nothing: confirm that the clipboard contains an image, then make Sample Workbench active and paste again.
- Saving to a specific local folder failed: enable the related local-save permission in
System Settingsfirst. Without it, chooseDownloadto save into the browser download folder. - Copy failed: manually select the code field or coordinate text, then copy it.
To continue from the same screenshot, switch to Bitmap Dictionary Tool or Text Element Capture.