Skip to content

Instantly share code, notes, and snippets.

@nikola
Created November 11, 2014 16:23
Show Gist options
  • Save nikola/aa82d6f9c224aa7dac29 to your computer and use it in GitHub Desktop.
Save nikola/aa82d6f9c224aa7dac29 to your computer and use it in GitHub Desktop.
Get Win32 Color Brush
import ctypes
def getColorBrush(red=0, green=0, blue=0):
class _COLORREF(ctypes.Structure):
_fields_ = [
('byRed', ctypes.c_byte),
('byGreen', ctypes.c_byte),
('byBlue', ctypes.c_byte),
]
return ctypes.windll.gdi32.CreateSolidBrush(_COLORREF(red, green, blue))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment