Based on example from Generative Design Hello, Color P.1.0
book
The ability to directly influence 16, 777, 216 colours gives us amazing freedom. Simultaneous contrast–without which it would be be possible to perceive colors–is illustrated here by juxtaposing a number of color combinations...
The x-value of the mouse position defines the size of the inside colour field, the y-value the hue.
xxxxxxxxxx
<html lang="en">
<head>
<meta charset="utf-8">
<title>d3 | hello colour hsl Generative Design</title>
<meta name="author" content="Sundar Singh | eesur.com">
<link rel="stylesheet" href="main.css">
<script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>
<!-- <script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js" charset="utf-8"></script> -->
</head>
<section id='colours'></section>
<script src="d3_code_hello_colour.js" charset="utf-8"></script>
</body>
</html>
https://d3js.org/d3.v3.min.js
https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js