ui.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:surface-orientation 作者: virtualguywithabowtie 项目源码 文件源码
def __pixel_at(x, y):
    #Returns (r, g, b) color code for a pixel with given coordinates (each value is in 0..256 limits)
    root_window = gdk.get_default_root_window()
    buf = gdk.pixbuf_get_from_window(root_window, x, y, 1, 1)
    pixels = buf.get_pixels()
    if type(pixels) == type(""):
        rgb = tuple([int(byte.encode('hex'), 16) for byte in pixels])[0:3]
    else:
        rgb = tuple(pixels)[0:3]
    return rgb
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号