Skip to content

Instantly share code, notes, and snippets.

View kiwwisk's full-sized avatar
🏠
Working from home

Andrej Kesely kiwwisk

🏠
Working from home
View GitHub Profile
@kiwwisk
kiwwisk / closest_color_name.py
Created December 31, 2019 19:04
Get closest color name - Python
colors = {"Absolute Zero": (0, 72, 186), "Acid green": (176, 191, 26), "Aero": (124, 185, 232), "Aero blue": (201, 255, 229), "African violet": (178, 132, 190), "Air superiority blue": (114, 160, 193), "Alabaster": (242, 240, 230), "Alice blue": (240, 248, 255), "Alloy orange": (196, 98, 16), "Almond": (239, 222, 205), "Amaranth": (229, 43, 80), "Amaranth deep purple": (159, 43, 104), "Amaranth pink": (241, 156, 187), "Amaranth purple": (171, 39, 79), "Amaranth red": (211, 33, 45), "Amazon": (59, 122, 87), "Amber": (255, 191, 0), "Amber (SAE/ECE)": (255, 126, 0), "Amethyst": (153, 102, 204), "Android green": (164, 198, 57), "Antique brass": (205, 149, 117), "Antique bronze": (102, 93, 30), "Antique fuchsia": (145, 92, 131), "Antique ruby": (132, 27, 45), "Antique white": (250, 235, 215), "Ao (English)": (0, 128, 0), "Apple green": (141, 182, 0), "Apricot": (251, 206, 177), "Aqua": (0, 255, 255), "Aquamarine": (127, 255, 212), "Arctic lime": (208, 255, 20), "Argentinian blue": (108, 180, 238), "Army green": (7
@kiwwisk
kiwwisk / sdl2_opengl_skeleton.py
Created April 13, 2017 06:13
Skeleton for SDL2/OpenGL application in Python 3. Game loop has fixed time step, rendering is going at full speed.
#
# Skeleton for SDL2/OpenGL application in Python
# with fixed logic time step, rendering is going still at full speed.
#
# To turn debug logging messages on, run with -v parameter:
# python <script_name.py> -v
#
import argparse
import logging