Rename Color#hilite -> Color#highlight.

This commit is contained in:
Jürg Lehni 2013-04-09 08:51:14 -07:00
parent 495eef2ee4
commit b9532f6a1a
3 changed files with 15 additions and 15 deletions

View file

@ -61,7 +61,7 @@
vector.length += (grow ? 1 : -1); vector.length += (grow ? 1 : -1);
vector.angle += 5; vector.angle += 5;
} }
gradientColor.hilite = mouseDown ? point : point + vector; gradientColor.highlight = mouseDown ? point : point + vector;
} }
function onResize(event) { function onResize(event) {

View file

@ -48,7 +48,7 @@ var Color = this.Color = Base.extend(new function() {
rgb: ['red', 'green', 'blue'], rgb: ['red', 'green', 'blue'],
hsb: ['hue', 'saturation', 'brightness'], hsb: ['hue', 'saturation', 'brightness'],
hsl: ['hue', 'saturation', 'lightness'], hsl: ['hue', 'saturation', 'lightness'],
gradient: ['gradient', 'origin', 'destination', 'hilite'] gradient: ['gradient', 'origin', 'destination', 'highlight']
}; };
var parsers = {}, // Parsers of values for setters, by type and property var parsers = {}, // Parsers of values for setters, by type and property
@ -243,7 +243,7 @@ var Color = this.Color = Base.extend(new function() {
? function(value) { ? function(value) {
// ..., clone, readNull); // ..., clone, readNull);
return Point.read(arguments, 0, 0, true, return Point.read(arguments, 0, 0, true,
name === 'hilite'); name === 'highlight');
} }
: function(value) { : function(value) {
return Math.min(Math.max(value, 0), 1); return Math.min(Math.max(value, 0), 1);
@ -326,7 +326,7 @@ var Color = this.Color = Base.extend(new function() {
* @param {Gradient} gradient * @param {Gradient} gradient
* @param {Point} origin * @param {Point} origin
* @param {Point} destination * @param {Point} destination
* @param {Point} [hilite] * @param {Point} [highlight]
* *
* @example {@paperscript height=200} * @example {@paperscript height=200}
* // Applying a linear gradient color containing evenly distributed * // Applying a linear gradient color containing evenly distributed
@ -462,7 +462,7 @@ var Color = this.Color = Base.extend(new function() {
: argType === 'object' && arg.length != null : argType === 'object' && arg.length != null
? arg ? arg
: null; : null;
// The various branches below produces a values array if the valus // The various branches below produces a values array if the values
// still need parsing, and a components array if they are already // still need parsing, and a components array if they are already
// parsed. // parsed.
if (values) { if (values) {
@ -722,13 +722,13 @@ var Color = this.Color = Base.extend(new function() {
canvasGradient; canvasGradient;
if (gradient._radial) { if (gradient._radial) {
var radius = destination.getDistance(origin), var radius = destination.getDistance(origin),
hilite = components[3]; highlight = components[3];
if (hilite) { if (highlight) {
var vector = hilite.subtract(origin); var vector = highlight.subtract(origin);
if (vector.getLength() > radius) if (vector.getLength() > radius)
hilite = origin.add(vector.normalize(radius - 0.1)); highlight = origin.add(vector.normalize(radius - 0.1));
} }
var start = hilite || origin; var start = highlight || origin;
canvasGradient = ctx.createRadialGradient(start.x, start.y, canvasGradient = ctx.createRadialGradient(start.x, start.y,
0, origin.x, origin.y, radius); 0, origin.x, origin.y, radius);
} else { } else {
@ -952,9 +952,9 @@ var Color = this.Color = Base.extend(new function() {
*/ */
/** /**
* The hilite point of the gradient. * The highlight point of the gradient.
* *
* @name Color#hilite * @name Color#highlight
* @property * @property
* @type Point * @type Point
* *
@ -975,9 +975,9 @@ var Color = this.Color = Base.extend(new function() {
* path.fillColor = gradientColor; * path.fillColor = gradientColor;
* *
* function onMouseMove(event) { * function onMouseMove(event) {
* // Set the origin hilite of the path's gradient color * // Set the origin highlight of the path's gradient color
* // to the position of the mouse: * // to the position of the mouse:
* path.fillColor.hilite = event.point; * path.fillColor.highlight = event.point;
* } * }
*/ */

View file

@ -353,7 +353,7 @@ new function() {
cy: origin.y, cy: origin.y,
r: origin.getDistance(destination) r: origin.getDistance(destination)
}; };
var highlight = color.getHilite(); var highlight = color.getHighlight();
if (highlight) { if (highlight) {
highlight = highlight.transform(matrix); highlight = highlight.transform(matrix);
attrs.fx = highlight.x; attrs.fx = highlight.x;