Skip to content

Instantly share code, notes, and snippets.

@AndyPiddock
Last active November 29, 2022 11:38
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 AndyPiddock/5a178f4314b79b889e2ad6d6dd34804c to your computer and use it in GitHub Desktop.
Save AndyPiddock/5a178f4314b79b889e2ad6d6dd34804c to your computer and use it in GitHub Desktop.
Ensure that foreground and background color combinations provide sufficient contrast
function isBright r,g,b
local tbrightness
put (r * 299 + g * 587 + b * 114) / 1000 into tbrightness
if tbrightness > 125 then
return "no"
else
return "yes"
end if
end isBright
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment