Skip to content

Instantly share code, notes, and snippets.

@kunthar
Created February 20, 2014 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunthar/9104328 to your computer and use it in GitHub Desktop.
Save kunthar/9104328 to your computer and use it in GitHub Desktop.
websafe colors
def getwebsafe(r,g,b):
rw = 51 * ((int(r)+25)//51)
gw = 51 * ((int(g)+25)//51)
bw = 51 * ((int(b)+25)//51)
return (rw,gw,bw)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment