Teach our kids to code scriptographer scripts
Last year Christina Winkless and I created a poster for Emma Mulqueeny’s petition on teaching coding in schools.
Back then, we ended up releasing only 1 of our 7 poster designs. Below i’d like to share the other Scriptographer sketches I came up with for the other posters.
var blueCircle = new Path.Circle(new Point(-100, 110), 120); blueCircle.fillColor = "#66CCCC"; blueCircle.blendMode = "multiply"; var greenCircle = new Path.Circle(new Point(100, 110), 120); greenCircle.fillColor = "#CCCC66"; greenCircle.blendMode = "multiply"; var pinkCircle = new Path.Circle(new Point(0, 0), 120); pinkCircle.fillColor = "#FF6666"; pinkCircle.blendMode = "multiply";
var numberOfLines = 360;
var angle = 0, radius = 180;
var colors = ["#576372", "#5CC4BE", "#C8DC67", "#F26B6C", "#F6D86B", "#F26B43"];
for(var i = 0; i < numberOfLines; i++){
angle = (i * (360 / numberOfLines)) * Math.PI / 180;
var center = document.bounds.center;
var p1 = center;
var p2 = new Point(center.x + Math.cos(angle) * radius, center.y + Math.sin(angle) * radius);
createLine(p1, p2);
}
function createLine(p1, p2){
var line = new Path.Line(p1, p2){
strokeColor:getRandomColor()
};
}
function getRandomColor(){
return colors[Math.floor(randomNumber(0, colors.length-1))];
}
function randomNumber(min, max){
return min + Math.random() * (max - min);
}
var numberOfLines = 360;
var angle = 0, radius = 190, lineRadius = 0, lineAngleIncrement = 0;
var colors = ["#576372", "#5CC4BE", "#C8DC67", "#F26B6C", "#F6D86B", "#F26B43"];
for(var i = 0; i < numberOfLines; i++){
angle = (i * (360 / numberOfLines)) * Math.PI / 180;
lineAngleIncrement += 0.07;
lineRadius = Math.sin(lineAngleIncrement) * radius;
var center = document.bounds.center;
var p1 = center;
var p2 = new Point(center.x + Math.cos(angle) * lineRadius, center.y + Math.sin(angle) * lineRadius);
createLine(p1, p2);
}
function createLine(p1, p2){
var line = new Path.Line(p1, p2){
strokeColor:getRandomColor()
};
}
function getRandomColor(){
return colors[Math.floor(randomNumber(0, colors.length-1))];
}
function randomNumber(min, max){
return min + Math.random() * (max - min);
}
var region = new Rectangle(0, 0, 400, 400);
var numberOfNodes = 100;
var nodesArray = [];
var nodeDistanceThreshold = 60;
var colors = ["#576372", "#5CC4BE", "#C8DC67", "#F26B6C", "#F6D86B", "#F26B43"];
for(var i = 0; i < numberOfNodes; i++){
var x = randomNumber(0, region.width);
var y = randomNumber(0, region.height);
var radius = randomNumber(1, 30);
createNode(x, y, radius);
}
for(var j = 0; j < nodesArray.length; j++){
for(var k = 0; k < nodesArray.length; k++){
var vector = nodesArray[j].position - nodesArray[k].position;
if(Math.floor(vector.length) < nodeDistanceThreshold){
var connectedLine = new Path.Line(nodesArray[j].position, nodesArray[k].position){
strokeColor:getRandomColor(),
opacity:0.2
};
}
}
}
function createNode(x, y, radius){
var node = new Path.Circle(new Point(x ,y), radius) {
fillColor:getRandomColor(),
blendMode:"multiply",
opacity:1
};
nodesArray.push(node);
}
function getRandomColor(){
return colors[Math.floor(randomNumber(0, colors.length-1))];
}
function randomNumber(min, max){
return min + Math.random() * (max - min);
}
var rows = 45
var columns = 36;
var colors = ["#576372", "#5CC4BE", "#C8DC67", "#F26B6C", "#F6D86B", "#F26B43"];
for(var x = 0; x < rows; x++){
for(var y = 0; y < columns; y++){
var size = randomNumber(5, 10);
createRectangle(x * 10, y * 10, size, size);
}
}
function createRectangle(x, y, width, height){
var rectangle = new Rectangle(x - width/2, y - height/2, width, height);
var roundedRectangle = new Path.RoundRectangle(rectangle, new Size(2, 2)){
strokeColor:null,
fillColor:getRandomColor()
};
}
function getRandomColor(){
return colors[Math.floor(randomNumber(0, colors.length-1))];
}
function randomNumber(min, max){
return min + Math.random() * (max - min);
}
var region = new Rectangle(0, 0, 400, 400);
var colors = ["#576372", "#5CC4BE", "#C8DC67", "#F26B6C", "#F6D86B", "#F26B43"];
var numberOfLines = 500;
for(var i = 0; i < numberOfLines; i++){
var lineStart = new Point(randomNumber(0, region.width), randomNumber(0, region.height));
var lineEnd = new Point(randomNumber(0, region.width), randomNumber(0, region.height));
var path = new Path.Line(lineStart, lineEnd);
path.style.strokeColor = getRandomColor();
path.opacity = randomNumber(0.5, 1);
}
function getRandomColor(){
return colors[Math.floor(randomNumber(0, colors.length-1))];
}
function randomNumber(min, max){
return min + Math.random() * (max - min);
}
var circleRadius = 0, spiralRadius = 0, angle = 0;
var numberOfCircles = 100;
for(var i = 0; i < numberOfCircles; i++){
angle++;
spiralRadius += 2;
circleRadius += 0.2;
var x = (document.size.width / 2) + Math.cos(angle) * spiralRadius;
var y = (document.size.height / 2) + Math.sin(angle) * spiralRadius;
createCircle(x, y, circleRadius);
}
function createCircle(x, y, radius){
var circle = new Path.Circle(new Point(x, y), radius){
fillColor:"#5CC4BE"
};
}
function randomNumber(min, max){
return min + Math.random() * (max - min);
}


















