Skip to content

Instantly share code, notes, and snippets.

@georules
Last active August 29, 2015 18:56
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 georules/0ab463796fba0d9c339a to your computer and use it in GitHub Desktop.
Save georules/0ab463796fba0d9c339a to your computer and use it in GitHub Desktop.
rgb thing
{"description":"rgb thing","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"tab":"edit","display_percent":0.7,"thumbnail":"http://i.imgur.com/7RBMqKo.png","fullscreen":false,"ajax-caching":true}
var svg = d3.select("svg")
var red = 255;
var green = 255;
var blue = 255;
var rr = "rgb("+red+",0,0)"
var gg = "rgb(0,"+green+",0)"
var bb = "rgb(0,0,"+blue+")"
var color = "rgb("+red+","+green+","+blue+")"
var totalcolor
svg.append("rect")
.attr("width", "100%")
.attr("height", "100%")
.attr("fill", color);
var x = 198
var y = 173
var h = 341
var w = 100
svg.append("rect")
.attr({
width: w,
height: h,
x: x,
y: y,
fill: rr
});
svg.append("rect")
.attr({
width: w,
height: h,
x: x+w,
y: y,
fill: gg
});
svg.append("rect")
.attr({
width: w,
height: h,
x: x+w*2,
y: y,
fill: bb
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment