Skip to content

Instantly share code, notes, and snippets.

@mforando
Created February 3, 2020 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mforando/1d0d0ea742ddaf5f7305c021223c8449 to your computer and use it in GitHub Desktop.
Save mforando/1d0d0ea742ddaf5f7305c021223c8449 to your computer and use it in GitHub Desktop.
RGB Equivalent Example
license: mit
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
body { margin:10;position:fixed;top:0;right:0;bottom:0;left:0; }
#main1{
background:rgba(0,131,101,.5);
}
#main2{
background:rgba(127,193,178,1);
}
</style>
</head>
<div id='main1'>foo</div>
<br/>
<div id='main2'>foo</div>
<body>
<script>
// Feel free to change or delete any of the code you see in this editor!
var svg = d3.select("body").append("svg")
.attr("width", 960)
.attr("height", 500)
svg.append("text")
.text("Edit the code below to change me!")
.attr("y", 200)
.attr("x", 120)
.attr("font-size", 36)
.attr("font-family", "monospace")
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment