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
var can = document.getElementById('canvas1'); | |
var ctx = can.getContext('2d'); | |
ctx.fillStyle = 'rgba(255,0,0,.4)'; | |
ctx.fillRect(20,20,20,80); | |
ctx.fillStyle = 'rgba(205,255,23,.4)'; | |
ctx.fillRect(30,30,40,50); | |
ctx.fillStyle = 'rgba(5,255,0,.4)'; | |
ctx.fillRect(40,50,80,20); |
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
<canvas id="canvas" width="1000" height="800"></canvas> | |
<script type="text/javascript"> | |
var canvas = document.getElementById("canvas"); | |
var context = canvas.getContext("2d"); | |
var scale = 1; | |
var originx = 0; | |
var originy = 0; | |
function draw(){ | |
context.fillStyle = "white"; |
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
function getBase64Image(img) { | |
// Create an empty canvas element | |
var canvas = document.createElement("canvas"); | |
canvas.width = img.width; | |
canvas.height = img.height; | |
// Copy the image contents to the canvas | |
var ctx = canvas.getContext("2d"); | |
ctx.drawImage(img, 0, 0); |
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
/** | |
* fullscreenify() | |
* Stretch canvas to size of window. | |
* | |
* Zachary Johnson | |
* http://www.zachstronaut.com/ | |
* | |
* See also: https://gist.github.com/1178522 | |
*/ |
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
/** | |
* Lorem Ipsum 0.0 | |
* | |
* Ken Frederick | |
* ken.frederick@gmx.de | |
* | |
* http://cargocollective.com/kenfrederick/ | |
* http://kenfrederick.blogspot.com/ | |
* | |
* A Lorem Ipsum/Greeking/Dummy-Text generator for Illustrator |
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
#target illustrator | |
csvCodeToName(); | |
function csvCodeToName(){ | |
if(!documents.length) return; | |
var aFile = File.openDialog( "select your csv file...",'*.csv',false ); | |
aFile.open("r"); | |
var optionFile = aFile.read(); |
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
#target illustrator | |
csvNameToCode(); | |
function csvNameToCode(){ | |
if(!documents.length) return; | |
var aFile = File.openDialog( "select your csv file...",'*.csv',false ); | |
aFile.open("r"); | |
var optionFile = aFile.read(); |
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
#target illustrator | |
main(); | |
function main(){ | |
if(!documents.length) return; | |
var doc = app.activeDocument; | |
var docTitle = doc.name; | |
var docTitle = docTitle.substring(0, docTitle.length - 3); |
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
#target illustrator | |
main(); | |
function main(){ | |
if(!documents.length) return; | |
var doc = app.activeDocument; | |
var allLayers = app.activeDocument.layers; |