indicator-tablet-mode.py 文件源码

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

项目:indicator-tablet-mode 作者: Aerilius 项目源码 文件源码
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])
    else:
        rgb = tuple(pixels)
    return rgb
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号