furkanalkaya
Kayıtlı Kullanıcı
- Katılım
- 1 Mar 2020
- Mesajlar
- 272
- Tepkime puanı
- 247
- Puanları
- 48
- Yaş
- 28
- Konum
- Kayseri
- Web sitesi
- www.furkanalkaya.com
Python:
import win32api
import pyscreeze
from pynput import keyboard
import os
def rgb2hex(r,g,b):
return "#{:02x}{:02x}{:02x}".format(r,g,b).upper()
def kopyala():
cursor_pos = win32api.GetCursorPos()
screen = pyscreeze.screenshot()
rgb = screen.getpixel(cursor_pos)
red = rgb[0]
green = rgb[1]
blue = rgb[2]
print("Red: {} Green: {} Blue: {}".format(red, green, blue))
print("Hex Code: {}".format(rgb2hex(red, green, blue)))
os.system("cls")
with keyboard.GlobalHotKeys({"<ctrl>+d": kopyala, "q": quit}) as h:
h.join()
win32api : Mouse pozisyonunu almak için ,
pyscreeze : Ekran görüntüsü almak için ,
pynput : Klavyeden giriş almak için kullanılmıştır.