获取屏幕上某点颜色 RGB (screen.get_color_rgb)

声明

, 绿,= screen.get_color_rgb(横坐标, 纵坐标)

参数及返回值

  • 横坐标, 纵坐标
    • 整数型,代表目标点的坐标
  • 红, 绿, 蓝
    • 整数型,返回目标点颜色的 红、绿、蓝 值,取值范围 0~255

说明

获取屏幕上某个坐标点的颜色并拆分成 红(R) 绿(G) 蓝(B) 形式

示例

local r, g, b = screen.get_color_rgb(512, 133)
print(r,g,b)
if r==0xff and g==0xff and b==0xff then
    print("512, 133 这个点是纯白色")
end
powered by GitbookFile Modify: 2021-03-27 23:14:19

results matching ""

    No results matching ""