D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
st44100
Full window
Github gist
// source http://jsbin.com/tusehi
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>JS Bin</title> </head> <body> <script id="jsbin-javascript"> var rgb = [255, 10, 10] c = [0, 0, 0] mix = 0.1 var newrgb2 = [ Math.floor(rgb[0] + (c[0] - rgb[0]) * mix), Math.floor(rgb[1] + (c[1] - rgb[1]) * mix), Math.floor(rgb[2] + (c[2] - rgb[2]) * mix) ]; console.log(newrgb2); </script> <script id="jsbin-source-javascript" type="text/javascript">var rgb = [255, 10, 10] c = [0, 0, 0] mix = 0.1 var newrgb2 = [ Math.floor(rgb[0] + (c[0] - rgb[0]) * mix), Math.floor(rgb[1] + (c[1] - rgb[1]) * mix), Math.floor(rgb[2] + (c[2] - rgb[2]) * mix) ]; console.log(newrgb2); </script></body> </html>