Built with blockbuilder.org
Created
February 19, 2020 14:49
-
-
Save mforando/750771042f15302abdc9c192e8ebee1f to your computer and use it in GitHub Desktop.
Color Palette Reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<style> | |
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } | |
</style> | |
</head> | |
<div id="cont"> | |
</div> | |
<body> | |
<script> | |
var divs = d3.select("#cont") | |
.selectAll(".colordivs") | |
.data(["#A05DA5","#2B92D0","#84A743","#5A514C","#F24F26","#8B827D","#EFAC41","#008465"]) | |
divs.enter() | |
.append('div') | |
.attr('class', 'colordivs'); | |
d3.selectAll('.colordivs') | |
.append('div') | |
.style('display', 'inline-block') | |
.style('background', (d)=>{return d}) | |
.style('width', '15px') | |
.style('height', '15px').style('margin-right', '10px') | |
.style('border', '1px solid black'); | |
d3.selectAll('.colordivs') | |
.append('div') | |
.style('display', 'inline-block') | |
.text((d)=>{return d}) | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment