Skip to content

Instantly share code, notes, and snippets.

@eyelash
Created April 25, 2017 11:36
Show Gist options
  • Select an option

  • Save eyelash/394ba6a8745aafefd6cd810923a9c489 to your computer and use it in GitHub Desktop.

Select an option

Save eyelash/394ba6a8745aafefd6cd810923a9c489 to your computer and use it in GitHub Desktop.
@function hsv($h, $s, $v) {
@return mix(mix(
if($h < 60, rgb(255, $h/60*255, 0),
if($h < 120, rgb((120-$h)/60*255, 255, 0),
if($h < 180, rgb(0, 255, ($h-120)/60*255),
if($h < 240, rgb(0, (240-$h)/60*255, 255),
if($h < 300, rgb(($h-240)/60*255, 0, 255),
rgb(255, 0, (360-$h)/60*255)))))),
#fff, $s), #000, $v);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment