ScriptTap
ColorClassify

Command video guide

ColorClassify

ColorClassify turns stored Hex colors into useful numerical codes or text labels for later decisions. It does not read the screen itself. This Overview shows the current options without running a script. The demonstration tabs preserve the complete supporting setup and visible results.

Source Mode Single reads one prior Hex variable, not a literal color. Array reads a segment of a declared Hex array using one array letter, a one-based Start and Count. Use In chooses This Script Only or Script Thread for the result scope. Output Type is Integer, Decimal or String; Hex is not an output-type option. Single uses a scalar Output name. Array uses one Output Array letter and requires a previously declared array of that selected type.

Confidence is a literal whole number from 1 to 100; 100 requires an exact RGB match and lower values allow more channel difference. The fresh command starts at 90. It is not a screen-pixel coverage percentage. No Match is a fallback compatible with the selected output type.

Rows defines up to 16 targets. Each Color is a six-digit Hex literal or prior Hex variable; Result must match the selected output type. Name is optional. Plus adds a row and its red X removes it. Rows are checked in order: the first qualifying match wins, not the closest color. Hex Array instead scans an existing declared Hex target array from Start for Count slots. It skips missing or unwritten slots rather than treating them as black. Integer or Decimal returns the matched target's absolute slot index; String returns its normalized Hex color as text. A target Count of zero produces No Match.

Array source outputs begin at slot 1, aligned to offsets in the source range rather than absolute source indexes. Unwritten source slots leave corresponding output slots untouched without compaction. A written 000000 is a real black color; source Count zero writes nothing. Starts use 1–4096 and counts 0–4096, as literal integers or prior Integer variables. For Array source, complete ranges must fit declared capacities and the output array must accommodate the requested count. Invalid consumed colors, type or bounds can reject that command's whole Array output batch before publication. These array-batch guarantees must not be assumed for Single mode.

Changing Source Mode or Targets resets mode-specific fields; review the new required inputs afterward. This Overview closes its draft without Save or Play. For a complete working example, choose a demonstration tab.

Overview

Step-by-step guide

  1. Step 01

    Color Classify turns stored colors into useful numbers or labels, so later commands can make decisions using them. It does not read the screen itself. This overview explains the source and target options without running a script. The other tabs contain complete working examples.

    ColorClassify: Overview step 1: Color Classify turns stored colors into useful numbers or labels, so later commands can make decisions using them. It does not read the screen itself. This overview explains the source and target options without running a script. The other tabs contain complete working examples.
  2. Step 02

    Under Advanced, drag Color Classify into the script, then open the new row. There is no separate Basic or Advanced mode inside this command.

    ColorClassify: Overview step 2: Under Advanced, drag Color Classify into the script, then open the new row. There is no separate Basic or Advanced mode inside this command.
  3. Step 03

    Source Mode has Single and Array options. Single reads one previously assigned Hex variable, entered in Source Hex. This is a variable name, not a literal color code. Set Variable or a screen-reading command can supply the color earlier in the script.

    ColorClassify: Overview step 3: Source Mode has Single and Array options. Single reads one previously assigned Hex variable, entered in Source Hex. This is a variable name, not a literal color code. Set Variable or a screen-reading command can supply the color earlier in the script.
  4. Step 04

    Use In selects the scope for the result. This Script Only keeps it local. Script Thread shares it within the parent's call tree. Keep the variables and any declared arrays in the appropriate scope.

    ColorClassify: Overview step 4: Use In selects the scope for the result. This Script Only keeps it local. Script Thread shares it within the parent's call tree. Keep the variables and any declared arrays in the appropriate scope.
  5. Step 05

    Confidence controls how closely the source and target colors must match. Enter a whole number from one through one hundred. One hundred requires an exact R G B match. Lower values allow more difference. The new command starts at ninety; this is not a percentage of pixels found on the screen.

    ColorClassify: Overview step 5: Confidence controls how closely the source and target colors must match. Enter a whole number from one through one hundred. One hundred requires an exact R G B match. Lower values allow more difference. The new command starts at ninety; this is not a percentage of pixels found on the screen.
  6. Step 06

    Output Type can be Integer for whole-number codes, Decimal for fractional values, or String for text labels. With a Single source, Output names one destination variable of that type. The source color itself is not changed.

    ColorClassify: Overview step 6: Output Type can be Integer for whole-number codes, Decimal for fractional values, or String for text labels. With a Single source, Output names one destination variable of that type. The source color itself is not changed.
  7. Step 07

    No Match is the fallback result when no target qualifies. Use a value compatible with the selected output type. In Rows mode, every row's Result must use that same type too.

    ColorClassify: Overview step 7: No Match is the fallback result when no target qualifies. Use a value compatible with the selected output type. In Rows mode, every row's Result must use that same type too.
  8. Step 08

    Targets has two choices: Rows and Hex Array. Rows lets you define the colors and their results here. Color accepts a six-digit Hex color or a prior Hex variable. Result is the value to write when that color matches. Name is an optional label for readability.

    ColorClassify: Overview step 8: Targets has two choices: Rows and Hex Array. Rows lets you define the colors and their results here. Color accepts a six-digit Hex color or a prior Hex variable. Result is the value to write when that color matches. Name is an optional label for readability.
  9. Step 09

    Use plus to add another target, up to sixteen rows. The red X removes an unwanted row. Targets are checked in order, and the first match wins. It does not search for the closest match, so order overlapping targets by which result should take priority.

    ColorClassify: Overview step 9: Use plus to add another target, up to sixteen rows. The red X removes an unwanted row. Targets are checked in order, and the first match wins. It does not search for the closest match, so order overlapping targets by which result should take priority.
  10. Step 10

    Hex Array uses colors already stored in a declared Hex array. Select it, then enter the array letter, a one-based Start, and a Count. Start and Count can be literal whole numbers or previously assigned Integer variables. Missing or unwritten target slots are skipped, not treated as black.

    ColorClassify: Overview step 10: Hex Array uses colors already stored in a declared Hex array. Select it, then enter the array letter, a one-based Start, and a Count. Start and Count can be literal whole numbers or previously assigned Integer variables. Missing or unwritten target slots are skipped, not treated as black.
  11. Step 11

    With Hex Array targets, the result is automatic. Integer and Decimal return the matched target's actual array index. String returns the matched Hex color as text. The first qualifying target wins. If none qualifies, No Match is used; a target Count of zero also produces no match.

    ColorClassify: Overview step 11: With Hex Array targets, the result is automatic. Integer and Decimal return the matched target's actual array index. String returns the matched Hex color as text. The first qualifying target wins. If none qualifies, No Match is used; a target Count of zero also produces no match.
  12. Step 12

    Switch Source Mode to Array to classify several stored colors. Source Array is one declared Hex array letter. Start chooses its first slot and Count chooses how many slots to process. Output Array is one array letter, not a scalar variable name. Declare that array earlier with the selected Integer, Decimal or String type.

    ColorClassify: Overview step 12: Switch Source Mode to Array to classify several stored colors. Source Array is one declared Hex array letter. Start chooses its first slot and Count chooses how many slots to process. Output Array is one array letter, not a scalar variable name. Declare that array earlier with the selected Integer, Decimal or String type.
  13. Step 13

    Array results begin at output slot one, aligned with offsets in the selected source range. They do not retain the source's absolute indexes. An unwritten source slot leaves the corresponding output slot untouched without shifting later results. A source Count of zero writes nothing. A written black color is still a real color.

    ColorClassify: Overview step 13: Array results begin at output slot one, aligned with offsets in the selected source range. They do not retain the source's absolute indexes. An unwritten source slot leaves the corresponding output slot untouched without shifting later results. A source Count of zero writes nothing. A written black color is still a real color.
  14. Step 14

    Array source works with either Rows or Hex Array targets. Choose the combination you need. Source and target starts range from one to four thousand and ninety-six; counts range from zero to four thousand and ninety-six. For Array source, the complete selected ranges must fit their declared capacities, and the output array must hold the requested count.

    ColorClassify: Overview step 14: Array source works with either Rows or Hex Array targets. Choose the combination you need. Source and target starts range from one to four thousand and ninety-six; counts range from zero to four thousand and ninety-six. For Array source, the complete selected ranges must fit their declared capacities, and the output array must hold the requested count.
  15. Step 15

    An invalid color, incompatible output type, or invalid range can reject an Array classification before any of that command's results are written. Check Run Logs when a result is missing. Changing a source or target mode also resets mode-specific fields, so review the required values after switching.

    ColorClassify: Overview step 15: An invalid color, incompatible output type, or invalid range can reject an Array classification before any of that command's results are written. Check Run Logs when a result is missing. Changing a source or target mode also resets mode-specific fields, so review the required values after switching.
  16. Step 16

    This was an options tour, not a finished script. Close the draft without saving or pressing Play. Use the demonstration tabs to see the supporting assignments and a visible result. Choose the smallest setup that makes your color classifications useful.

    ColorClassify: Overview step 16: This was an options tour, not a finished script. Close the draft without saving or pressing Play. Use the demonstration tabs to see the supporting assignments and a visible result. Choose the smallest setup that makes your color classifications useful.