Skip to main content

Image Position & Color Picker

Provides pickers to select one or more pixels on a screenshot and obtain their positions and/or colors.

Type pos selects a single pixel and returns an array of two numbers: x and y.

{ 512, 373 }

Type color selects a single pixel and returns its RGB color as a number:

0x3c1f8b

Type poscolor selects a single pixel and returns an array of three numbers: x, y, and RGB color number:

{ 512, 373, 0x3c1f8b }

Type poscolors selects multiple pixels and returns a 2D array: each entry contains x, y, and RGB color number:

{
{ 512, 373, 0x3c1f8b },
{ 512, 374, 0x3c1f7c },
{ 512, 375, 0x3c1f89 },
-- ...
}

Example

local group, name

group = 'Image/Color'
name = 'if (screen.is_colors(poscolors, 90)) then ... end'

return {
name = string.format('%s - %s', group, name),
description = "Multi-point color match on screen",
arguments = {
{type = 'poscolors'},
},
-- default = nil,
generator = function(poscolors)
local pcs = {}
for i, pc in ipairs(poscolors) do
pcs[#pcs + 1] = string.format('\t{ %4d, %4d, 0x%06x}, -- %3d\n', pc[1], pc[2], pc[3] & 0x00ffffff, i)
end
return string.format([[\
if (screen.is_colors({\
%s}, 90)) then\
@@\
end]], table.concat(pcs))
end,
}

IMG_0009.PNG

IMG_0010.PNG

IMG_0013.PNG