Multi-Hue Color Scales with Bezier Interpolation

Developer
Size
2,298 Kb
Views
62,744

How do I make an multi-hue color scales with bezier interpolation?

What is a multi-hue color scales with bezier interpolation? How do you make a multi-hue color scales with bezier interpolation? This script and codes were developed by Steve Pepple on 22 June 2022, Wednesday.

Multi-Hue Color Scales with Bezier Interpolation Previews

Multi-Hue Color Scales with Bezier Interpolation - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Multi-Hue Color Scales with Bezier Interpolation</title> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<p>Bezier Scale</p>
<p class="small">Bezier interpolate between White to Black and Yellow to Blue</p>
<code>chroma.bezier(['white', 'yellow', 'blue', 'black'])</code>
<div id="bezier1" class="scale"></div>
<p>Bezier Scale</p>
<p class="small">Bezier interpolate between White to Black and Yellow to Green</p>
<code>chroma.bezier(['white', 'yellow', 'green', 'black'])</code>
<div id="bezier2" class="scale"></div>
<p>Bezier Scale</p>
<p class="small">Bezier interpolate between White to Black and Yellow to Red</p>
<code>chroma.bezier(['white', 'yellow', 'red', 'black'])</code>
<div id="bezier3" class="scale"></div> <script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.12/d3.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/chroma-js/1.1.1/chroma.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Multi-Hue Color Scales with Bezier Interpolation - Script Codes CSS Codes

body { background: #F7F7F7; font-family: Helvetica; padding-left: 30px; margin:0px; padding-top: 0px; }
p { color: #222; clear: left; padding-top: 12px; margin-bottom: 8px; font-weight: 200; font-size: 1.2em }
p.small { color: #444; font-size: 0.9em; padding-top: 0px; margin-top:0px; }
.scale { margin-bottom: 2vm;}
.color { float:left; margin-right: 2vw;
}

Multi-Hue Color Scales with Bezier Interpolation - Script Codes JS Codes

scale = d3.scale.linear();
var bezier_1 = chroma_scale(10, chroma.bezier(['white', 'yellow', 'blue', 'black']));
showColors("bezier1", bezier_1)
var bezier_2 = chroma_scale(10, chroma.bezier(['white', 'yellow', 'green', 'black']));
showColors("bezier2", bezier_2)
var bezier_3 = chroma_scale(10, chroma.bezier(['white', 'yellow', 'red', 'black']));
showColors("bezier3", bezier_3)
function showColors(id, colors) { var box = $("#" + id); _.each(colors, function(color) { console.log(color.hex() + ",") var item = $("<div class='color'>"); item.css("background", color.hex()) item.css("height","4vw"); item.css("width", "4vw") box.append(item) });
}
function chroma_scale(length, chroma_scale) { var colors = []; scale.domain([1, length]) var color_scale = chroma.scale(); for (var i = 1; i <= length; i++) { var val = scale(i) colors.push(chroma_scale(val)); } return colors;
}
Multi-Hue Color Scales with Bezier Interpolation - Script Codes
Multi-Hue Color Scales with Bezier Interpolation - Script Codes
Home Page Home
Developer Steve Pepple
Username stevepepple
Uploaded June 22, 2022
Rating 3
Size 2,298 Kb
Views 62,744
Do you need developer help for Multi-Hue Color Scales with Bezier Interpolation?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Steve Pepple (stevepepple) Script Codes
Create amazing Facebook ads with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!