paper.js/src/svg/SVGStyles.js

32 lines
849 B
JavaScript
Raw Normal View History

/*
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey
* http://lehni.org/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
*
* All rights reserved.
*/
2013-04-23 10:19:08 -04:00
var SVGStyles = Base.each({
2012-11-05 22:26:54 -05:00
fillColor: ['fill', 'color'],
strokeColor: ['stroke', 'color'],
strokeWidth: ['stroke-width', 'number'],
strokeCap: ['stroke-linecap', 'string'],
strokeJoin: ['stroke-linejoin', 'string'],
miterLimit: ['stroke-miterlimit', 'number'],
dashArray: ['stroke-dasharray', 'array'],
dashOffset: ['stroke-dashoffset', 'number']
}, function(entry, key) {
var part = Base.capitalize(key);
this[key] = {
2012-11-05 22:26:54 -05:00
type: entry[1],
property: key,
attribute: entry[0],
get: 'get' + part,
set: 'set' + part
};
}, {});