Skip to content

Instantly share code, notes, and snippets.

View tdbe's full-sized avatar

Tudor tdbe

View GitHub Profile
@tdbe
tdbe / proper-js-color-conversion-algorithms.html
Last active May 11, 2021 00:41 — forked from mjackson/color-conversion-algorithms.js
rgbToHex, hexToRgb, hslToRgb, rgbToHsl, hslToRgb, rgbToHsv, hsvToRgb, hslToHex, hsvToHex, hexToHsv --- that's right you've finally found complete and proper color conversion algorithms in native JavaScript. Actually works as expected: in: 3 vals in browser format, out: array of 3 vals in browser format. Think of all the druggery I saved you :)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Color Picker</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">