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.

This commit is contained in:
Jürg Lehni 2011-11-10 19:16:34 +01:00
parent c4bea4d24c
commit 42d0e722db
19 changed files with 171 additions and 171 deletions

View file

@ -31,7 +31,7 @@
new Path.Circle(this.point, this.radius),
new Path.Circle(overlayPos, this.radius / 2)
]);
var color = new HSBColor(Math.random() * 360, 1, 1);
var color = new HsbColor(Math.random() * 360, 1, 1);
var gradient = new Gradient([color, 'black'], 'radial');
compound.children[0].fillColor = new GradientColor(gradient, this.point,
this.point + this.radius, overlayPos);
@ -39,7 +39,7 @@
var overlayColor = color.clone();
var fullOverlay = color.clone();
overlayColor.alpha = 0.5;
var overlayGradient = new Gradient([new RGBColor(1, 1, 1, 0.5), new RGBColor(1, 1, 1, 1)]);
var overlayGradient = new Gradient([new RgbColor(1, 1, 1, 0.5), new RgbColor(1, 1, 1, 1)]);
overlay.fillColor = new GradientColor(overlayGradient, overlayPos, overlayPos + this.radius / 2);
this.item = new Group([compound, overlay]);
},

View file

@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>HSLColor</title>
<title>HslColor</title>
<link rel="stylesheet" href="../css/style.css">
<script type="text/javascript" src="../../dist/paper.js"></script>
<script type="text/paperscript" canvas="canvas">
@ -35,7 +35,7 @@
var colors = [];
for (var i = 0; i < steps.saturation; i++) {
var saturation = i / steps.saturation;
var color = new HSLColor(hue, saturation, lightness);
var color = new HslColor(hue, saturation, lightness);
colors.push(color);
}
var gradient = new Gradient(colors, 'radial');