Commit graph

222 commits

Author SHA1 Message Date
Jürg Lehni
5afa1b1688 Allow direct passing of color arguments to gradient constructors as well as arrays. 2013-03-01 17:44:16 -08:00
Jürg Lehni
58fad6ed72 Switch from Gradient#type to separate LinearGradient / RadialGradient classes.
But remain backward compatible through direct calls to Gradient constructor.
2013-03-01 17:39:36 -08:00
Jürg Lehni
3f5d0a6925 Merge constructor._name with _type and use CamelCase for Item types. 2013-03-01 17:13:22 -08:00
Jürg Lehni
9d8cddbe42 Implement new private Format object that handles formatting of number, point, size and rectangle. 2013-02-28 19:14:05 -08:00
Jürg Lehni
ca3cc7f46d Define CanvasProvider.getContext() next to getCanvas(), and support both types in release(). 2013-02-12 16:06:24 -08:00
Jürg Lehni
51150cb20d Support CanvasProvider.get(width, height) arguments. 2013-02-12 15:57:02 -08:00
Jürg Lehni
357b7dbc54 Shorten CanvasProvider method names. 2013-02-12 15:53:27 -08:00
Jürg Lehni
fdd15e675f Add options argument to #toJson() methods, and use to implement optional fractional digit precision control. 2013-02-12 14:57:54 -08:00
Jürg Lehni
15554b8bf2 Simplify adding / referencing of JSON dictionary entries. 2013-02-11 19:31:58 -08:00
Jürg Lehni
366524d0a7 Implement JSON serialization for Gradient and GradientColor. 2013-02-11 19:22:18 -08:00
Jürg Lehni
629e16144a Define #_type property for both Symbol and Gradient and use it in SvgExport. 2013-02-11 18:23:41 -08:00
Jürg Lehni
e0d0eb175a Implement exporting of Gradients to SVG. 2013-02-10 19:38:35 -08:00
Jürg Lehni
565fb86430 Give any item / object that needs to be exported as a definition / symbol its own unique id.
This will be useful in SVG and JSON exporter.
2013-02-10 09:37:40 -08:00
Jürg Lehni
6c9c16ad3d Update copyright information comments, and year. 2013-01-28 18:03:27 -08:00
Jürg Lehni
5da4e89672 Return 'this' in more places to facilitate chained calls inside the library. 2012-12-31 20:07:28 +01:00
Jürg Lehni
4f83e0eee6 Commit first version of serialization / deserialization mechanism.
It appears to work fine already for Paths and Groups.
2012-12-27 12:45:55 +01:00
Jürg Lehni
0fb89bd3e0 Rename Color#_colorType to #_type, to prepare for serialization mechanism. 2012-12-27 00:48:56 +01:00
Jürg Lehni
8f093f6dd7 Remove all PORT comments, since we won't port back features to Scriptographer. 2012-12-25 16:07:48 +01:00
Jürg Lehni
05ab8910ea Optimise GradientStop constructor for better minification. 2012-12-18 13:49:29 +01:00
Jürg Lehni
87393d130d Make sure converting #saturation getter uses HSB, not HSL.
Fixes #111.
2012-12-17 23:03:02 +01:00
Jürg Lehni
62c7bb804b Add comment about caching _css values. 2012-12-08 20:12:36 -08:00
Jürg Lehni
68dc7e8b12 Correctly fix SVG alpha support through opacity attributes. 2012-12-08 20:09:24 -08:00
Jürg Lehni
86d3a3521b Avoid rgba() colors in SVG output since it's not part of SVG 1.1
Use fill- / stroke-opacity instead.
2012-12-01 12:44:54 -08:00
Jürg Lehni
f1abdccf85 Result of getAlpha() is always defined. 2012-12-01 12:34:45 -08:00
Jürg Lehni
f268c6e152 Rename Color#toCssString() to #toCss(), and only include alpha if its < 1. 2012-12-01 12:31:22 -08:00
Jürg Lehni
9ff39eb603 Define Color.random() similar to Point.random(). 2012-11-27 17:35:03 -08:00
Jürg Lehni
d671a08205 Introduce Base.toFloat() and rename Base.formatNumber() to Base.formatFloat() 2012-11-14 01:31:08 -08:00
Jonathan Puckey
494874ec8f Svg Importer: Fix handling of getDefinition for color values. 2012-11-08 14:29:48 +01:00
Jürg Lehni
35568c15f2 Implement transparent constant-substitution in prepro.js to shave of some extra bytes of final distribution file. 2012-11-05 18:11:44 -08:00
Jürg Lehni
6ed1d67ada Modernize Bootstrap.js, introduce Base.create() and use it instead of the Constructor.dont hack for object creation without the calling of initialize. 2012-11-03 21:49:37 -07:00
Jürg Lehni
30374ae3b4 Implement proper index independent argument list reading of basic types.
Implemented for Point, Size, Rectangle and Color.
2012-10-18 14:24:15 -07:00
Jürg Lehni
7329f4ef77 Improve handling of owner referencing in colors.
Allow one owner per Color only and clone colors when setting color styles. Gradient can still have multiple GradientColor owners. Closes #124.
2012-10-10 19:27:14 -07:00
Jürg Lehni
4d1920ee8b Improve Base.read() to support cloning of objects that are already provided in the required type. 2012-10-10 19:26:00 -07:00
Jürg Lehni
c51f2a0d3b Remove unnecessary variable declarations. 2012-09-30 19:50:30 -07:00
Jonathan Puckey
31b5a0647e Add change tracking to Gradient & GradientStop. 2012-03-04 19:14:13 +01:00
Jonathan Puckey
52385451f6 Resolve a few documentation todos. 2011-11-12 18:30:21 +01:00
Jürg Lehni
99a8532cca No need to set beans = true since we're always producing beans. 2011-11-11 14:03:36 +01:00
Jürg Lehni
e2eec3476d Add comments about backward compatible Color constructor names. 2011-11-10 20:00:20 +01:00
Jürg Lehni
42d0e722db Rename RGBColor -> RgbColor, to avoid clash with native constructor, and follow same naming convention for HsbColor and HslColor, but keep references to old names for PaperScript scopes for now. 2011-11-10 19:16:34 +01:00
Jürg Lehni
b51c1286da Add documentation for all color components. Closes #43. 2011-09-18 10:54:26 +02:00
Jonathan Puckey
38a4184ab5 Color: Avoid dividing by 0 in rgb-hsl converter. 2011-08-13 15:26:14 +02:00
Jürg Lehni
0e6aeac28c Fix HSLColor documentation. 2011-08-01 08:53:28 +01:00
Jürg Lehni
fc7da5fa13 Docs: Improve HSL example. 2011-07-31 15:46:26 +01:00
Jürg Lehni
6771475ffc Clean up comments. 2011-07-09 16:59:07 +02:00
Jürg Lehni
baf7136ef7 Compress HSL and HSB converters even more. 2011-07-07 00:19:13 +02:00
Jürg Lehni
adff506751 Rearrange converter sequence. 2011-07-07 00:19:01 +02:00
Jürg Lehni
41e25dc5f7 Remove converters that simply pass through other rgb converters and have Color#convert() handle that for us. 2011-07-07 00:02:38 +02:00
Jürg Lehni
16c31fc683 No need to initialize with 0 since we're always setting them again. 2011-07-06 23:54:34 +02:00
Jürg Lehni
769ae05ad8 Clean up HSB code a bit too. 2011-07-06 23:51:46 +02:00
Jürg Lehni
dfef99aa92 Clean up and further simplify HSL code. 2011-07-06 23:51:30 +02:00