Commit graph

222 commits

Author SHA1 Message Date
Jürg Lehni
4d999d57e2 Replace all type converting string compares with ===, !==. 2011-04-28 13:23:17 +01:00
Jürg Lehni
ac5dca4fc0 Update various comments about TODOs. 2011-04-26 17:04:15 +01:00
Jürg Lehni
9d2459d799 Rename '// Todo' to '// TODO', which is the convention. 2011-04-26 12:39:48 +01:00
Jonathan Puckey
5f05c85b42 Gradient: rename midPoint to rampPoint. 2011-04-07 17:12:00 +02:00
Jonathan Puckey
06df8b1288 Allow Gradient constructor to receive an array of colors or [color, midPoint]. Also allow the user to specify the type of the gradient in the constructor. 2011-04-07 17:01:49 +02:00
Jürg Lehni
aae88d7568 Optimise chained return statements. 2011-03-14 22:13:01 +01:00
Jürg Lehni
f02b7031a9 Reintroduce accidentally removed definition of _readNull: true. 2011-03-14 22:08:07 +01:00
Jürg Lehni
a48c130965 Improve comments. 2011-03-14 22:07:21 +01:00
Jonathan Puckey
46ee4c517d Optimize nameToRGBColor to also handle strings like rgb(0, 0, 0). 2011-03-14 13:54:57 +01:00
Jürg Lehni
bfd43b27fa Improve commens and get rid of for loop to in nameToRGBColor(). 2011-03-13 23:00:01 +01:00
Jürg Lehni
1c8c64c473 One more nameToRGBColor() simplification, by reversing return logic. 2011-03-13 22:57:01 +01:00
Jürg Lehni
a842b5faa6 Simplify nameToRGBColor() further: No need to create function in its own scope, simply use the inject scope to contain cache and context variables. 2011-03-13 22:55:20 +01:00
Jürg Lehni
21aa12271e Simplify nameToRGBColor() code a little: Shorter variables names, no need to save and restore context, as all we do is fillRect(). 2011-03-13 22:53:32 +01:00
Jonathan Puckey
e0753179e3 Clean up last commit a bit. 2011-03-13 20:16:04 +01:00
Jonathan Puckey
0d173e39bf Merge remote branch 'origin/master' 2011-03-13 20:15:00 +01:00
Jonathan Puckey
b004a83361 Color: avoid huge named color lookup table by drawing the named color on a canvas and reading its components. 2011-03-13 20:14:16 +01:00
Jürg Lehni
cd80db14d8 Rearrange color converters to group by pairs. 2011-03-13 18:41:32 +01:00
Jürg Lehni
d5fa3d7ae6 Merge remote-tracking branch 'origin/master'
Conflicts:
	src/item/Raster.js
2011-03-13 18:34:05 +01:00
Jürg Lehni
9d4af0ce9e Clean up recently caused Base.read() mess by introducing _readNull property,m setting it to true on Color and reverting to previous behavior for Point, Size and Rectangle, where dimensions of 0 are read by default if nothing is provided. 2011-03-13 18:31:00 +01:00
Jonathan Puckey
5079259a8e Small change to Color. 2011-03-12 15:16:17 +01:00
Jonathan Puckey
f57a7ba0d9 Use Math.min / Math.max to clamp component values in color classes. 2011-03-09 16:48:53 +01:00
Jonathan Puckey
08d66ae231 Color: small change. 2011-03-09 15:50:32 +01:00
Jonathan Puckey
87de9f4fa8 Further refactoring in Color. 2011-03-09 15:25:41 +01:00
Jonathan Puckey
30d2f16c8c Color: save a var statement. 2011-03-09 15:00:13 +01:00
Jonathan Puckey
da92ff9773 Check for min and max values in the different color component setters. 2011-03-09 14:48:16 +01:00
Jürg Lehni
41ce6279f1 Merge remote-tracking branch 'origin/master'
Conflicts:
	src/color/Color.js
2011-03-09 13:34:13 +00:00
Jürg Lehni
9fd0381b82 Minor clean-ups. 2011-03-09 13:31:40 +00:00
Jonathan Puckey
b7902635bf Color#setAlpha: comment out code using Math.min and Math.max, which was supposed to just be there to explain what is happening. 2011-03-09 14:31:30 +01:00
Jonathan Puckey
bda24fbd54 Color: simplify stringToRGB again. 2011-03-09 14:29:19 +01:00
Jonathan Puckey
eacf346aab Color: reintroduce hexToRGB to be called from stringToRGB. 2011-03-09 14:23:18 +01:00
Jonathan Puckey
741652aa9c Color: combine stringToRgb, namedToRgb and hexToRgb and optimize a bit. 2011-03-09 14:20:09 +01:00
Jonathan Puckey
00c4b5ee34 Small change to HSBColor#setHue. 2011-03-09 02:30:50 +01:00
Jonathan Puckey
62db3e56dd Implement HSBColor, introduce Color#convert(type) and refactor color classes. 2011-03-09 02:23:39 +01:00
Jürg Lehni
dd9340d522 Handle all the calls to Base.read() differently, by checking result for null and bailing out if it is. 2011-03-08 17:17:36 +00:00
Jürg Lehni
6a67052090 Update copyright / licensing comments. 2011-03-08 01:41:50 +00:00
Jürg Lehni
6db184341a Fix a small syntax error. 2011-03-07 18:36:13 +00:00
Jürg Lehni
2a0c393b85 Simplify HSB code a little. 2011-03-07 16:51:00 +00:00
Jonathan Puckey
d713102734 Implement Color#saturation / Color#hue / Color#brightness and allow chaining of color channel setters. 2011-03-07 15:59:35 +01:00
Jürg Lehni
e1a7aff2f0 Add copyright notice and license file. 2011-03-07 00:50:44 +00:00
Jürg Lehni
352b3f0d40 More work on Bootstrap core, move Base.isArray back to Array.isArray. 2011-03-05 13:53:18 +00:00
Jürg Lehni
836ee492ae More beans related refactoring. 2011-03-05 02:40:38 +00:00
Jürg Lehni
c313e702c9 Clean up a whole lot of beans access, and in the process of the refactoring improve canvas, context, size and bounds handling in Raster and PlacedSymbol. 2011-03-05 01:26:12 +00:00
Jürg Lehni
1d866ecb6c Clean up internal properties and beans in Color related classes. 2011-03-05 00:16:26 +00:00
Jürg Lehni
7355c2d4a7 Switch to using Base.isArray. 2011-03-04 21:47:00 +00:00
Jürg Lehni
f3663c04fe Compress code using Base.each side-car. 2011-03-04 20:55:11 +00:00
Jürg Lehni
1bd0127ece Remove dependency from full Bootstrap. 2011-03-04 20:54:57 +00:00
Jürg Lehni
93c3920505 Add definition of Base.capitalize() and remove dependencies of String#capitalize(). 2011-03-04 19:46:41 +00:00
Jonathan Puckey
acb6e850a0 Use toCssString() in Color#getCanvasStyle. 2011-03-04 18:14:24 +01:00
Jonathan Puckey
ff5ee13ba0 Fix Color#getCanvasStyle. 2011-03-04 17:54:36 +01:00
Jürg Lehni
92bf51a7cc Simplify the way the paper namespace is created and populated. 2011-03-04 13:34:31 +00:00
Jürg Lehni
c6d79f964c Generalise all read() functions in Base.read(), fix an issue in by making sure arguments passed to initialie are never larger than length, and have Color's initialize create an RGBColor, to still be able to use Color.read(). 2011-03-04 13:19:07 +00:00
Jürg Lehni
2b6dede883 Clean up white-spaces and line lengths. 2011-03-03 22:45:17 +00:00
Jürg Lehni
cbe29fd02b Rename Color#getCssString() to #toCssString(), to go with #toString(). 2011-03-03 17:36:53 +00:00
Jürg Lehni
2f63a65ded Clean up code. 2011-03-03 17:35:59 +00:00
Jürg Lehni
46a0589547 Use Error constructor correctly. 2011-03-03 17:29:40 +00:00
Jürg Lehni
484d74160b Set private properties directly in initialize(), no need to call setters. 2011-03-03 17:27:56 +00:00
Jürg Lehni
0efc23b25c Remove 2nd redundant definition of Gradient#getStops(). 2011-03-03 17:26:30 +00:00
Jürg Lehni
5ed30d7089 Make sure all files end on empty line. 2011-03-03 16:32:55 +00:00
Jürg Lehni
941c3c7346 Declare all classes as local variables, so they can be scoped. 2011-03-03 13:33:41 +00:00
Jürg Lehni
3a46ac3b54 Allow read() methods to receive an optional length parameter. 2011-03-03 13:15:55 +00:00
Jonathan Puckey
73df06150a Fix RGBColor#setGray. 2011-02-24 12:58:16 +01:00
Jonathan Puckey
357a8af6ec Clean up white spaces. 2011-02-21 03:32:39 +01:00
Jonathan Puckey
14943f428f Remove logging statement. 2011-02-21 00:27:02 +01:00
Jonathan Puckey
0458e3d916 Check for null in Color#read. 2011-02-21 00:25:45 +01:00
Jürg Lehni
ed752ed744 Pass ctor.dont to all constructor calls that are followed with explicit initialize() calls afterwards, to make sure it is only called once. 2011-02-20 01:45:53 +01:00
Jonathan Puckey
c0a93a8b66 Setters already handle point conversion. 2011-02-19 22:52:00 +01:00
Jonathan Puckey
10623ddb62 Implement Gradient, GradientColor, GradientStop. 2011-02-19 22:50:37 +01:00
Jonathan Puckey
57b7b364bc Nullify cssString cache when color/alpha values change. 2011-02-19 18:01:08 +01:00
Jonathan Puckey
c386f38b86 GrayColor: fix comment. 2011-02-19 17:22:20 +01:00
Jonathan Puckey
068c4dc1ca Add missing Color.js. 2011-02-19 17:10:26 +01:00
Jonathan Puckey
b944b82abe GrayColor: fix comments. 2011-02-19 17:08:08 +01:00
Jonathan Puckey
66105dd4ac Implement Color, RGBColor & GrayColor. 2011-02-19 17:05:39 +01:00