Skip to main content

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 Workbench from the main tool or action entry. It opens on the Color Picker page 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​

  1. After opening an image, zoom with the mouse wheel and drag the image so the target is easy to click.
  2. Move the pointer over the image. The magnifier shows the current coordinate and color.
  3. Click the target point. The point is added to the Point List.
  4. In the Point List, review the coordinate and color value, then copy them into your script.
  5. To pin several frequently used points, use Color Records. While the pointer is over the image, press 1 to 5 to 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:

  1. Hold Shift and drag to create a normal selection.
  2. If you need a second region, hold Meta/Ctrl and drag.
  3. In Code Templates, click Save Region Image.
  4. Enter a file name.
  5. Choose where to save it: Small Image Save Path, Project Path /res/, or Download.
  6. 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.

Save Region Image Template supports the filename variable $imgFileBaseName and the following variables:

  • 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: $shiftRectImgData and $metaRectImgData.

Test templates on a device​

Set the development test device in the text editor or the device context menu, click “Test on device” beside the template, and check the result in the editor’s device log. Stop any running or debugging script before testing.

Click the pencil beside a template title to edit its name, source code, and test wrapper, and preview the generated result. Click “Restore default templates” to reset it.

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

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 Settings first. Without it, choose Download to 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.