mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-06-30 06:50:27 -04:00
Clean up white-space.
This commit is contained in:
parent
e8919174f8
commit
70ae7486e9
1 changed files with 81 additions and 81 deletions
|
@ -326,28 +326,28 @@ var Color = Base.extend(new function() {
|
||||||
/**
|
/**
|
||||||
* Creates a HSB, HSL or gradient Color object from the properties of
|
* Creates a HSB, HSL or gradient Color object from the properties of
|
||||||
* the provided object:
|
* the provided object:
|
||||||
*
|
*
|
||||||
* <b>HSB Color</b>:<br>
|
* <b>HSB Color</b>:<br>
|
||||||
* {@code hue: Number} — the hue of the color as a value in
|
* {@code hue: Number} — the hue of the color as a value in
|
||||||
* degrees between {@code 0} and {@code 360}<br>
|
* degrees between {@code 0} and {@code 360}<br>
|
||||||
* {@code saturation: Number} — the saturation of the color as a
|
* {@code saturation: Number} — the saturation of the color as a
|
||||||
* value between {@code 0} and {@code 1}<br>
|
* value between {@code 0} and {@code 1}<br>
|
||||||
* {@code brightness: Number} — the brightness of the color as a
|
* {@code brightness: Number} — the brightness of the color as a
|
||||||
* value between {@code 0} and {@code 1}<br>
|
* value between {@code 0} and {@code 1}<br>
|
||||||
* {@code alpha: Number} — the alpha of the color as a value between
|
* {@code alpha: Number} — the alpha of the color as a value between
|
||||||
* {@code 0} and {@code 1}
|
* {@code 0} and {@code 1}
|
||||||
*
|
*
|
||||||
* <b>HSL Color</b>:<br>
|
* <b>HSL Color</b>:<br>
|
||||||
* {@code hue: Number} — the hue of the color as a value in
|
* {@code hue: Number} — the hue of the color as a value in
|
||||||
* degrees between {@code 0} and {@code 360}<br>
|
* degrees between {@code 0} and {@code 360}<br>
|
||||||
* {@code saturation: Number} — the saturation of the color as a
|
* {@code saturation: Number} — the saturation of the color as a
|
||||||
* value between {@code 0} and {@code 1}<br>
|
* value between {@code 0} and {@code 1}<br>
|
||||||
* {@code lightness: Number} — the lightness of the color as a
|
* {@code lightness: Number} — the lightness of the color as a
|
||||||
* value between {@code 0} and {@code 1}<br>
|
* value between {@code 0} and {@code 1}<br>
|
||||||
* {@code alpha: Number} — the alpha of the color as a value between
|
* {@code alpha: Number} — the alpha of the color as a value between
|
||||||
* {@code 0} and {@code 1}
|
* {@code 0} and {@code 1}
|
||||||
*
|
*
|
||||||
* <b>Gradient Color</b>:<br>
|
* <b>Gradient Color</b>:<br>
|
||||||
* {@code gradient: Gradient} — the gradient object that describes the
|
* {@code gradient: Gradient} — the gradient object that describes the
|
||||||
* color stops and type of gradient to be used.<br>
|
* color stops and type of gradient to be used.<br>
|
||||||
* {@code origin: Point} — the origin point of the gradient<br>
|
* {@code origin: Point} — the origin point of the gradient<br>
|
||||||
|
@ -371,38 +371,38 @@ var Color = Base.extend(new function() {
|
||||||
* // Create an HSB Color with a hue of 90 degrees, a saturation
|
* // Create an HSB Color with a hue of 90 degrees, a saturation
|
||||||
* // 100% and a brightness of 100%:
|
* // 100% and a brightness of 100%:
|
||||||
* circle.fillColor = { hue: 90, saturation: 1, brightness: 1 };
|
* circle.fillColor = { hue: 90, saturation: 1, brightness: 1 };
|
||||||
*
|
*
|
||||||
* @example {@paperscript}
|
* @example {@paperscript}
|
||||||
* // Creating a HSL Color:
|
* // Creating a HSL Color:
|
||||||
*
|
*
|
||||||
* // Create a circle shaped path at {x: 80, y: 50}
|
* // Create a circle shaped path at {x: 80, y: 50}
|
||||||
* // with a radius of 30:
|
* // with a radius of 30:
|
||||||
* var circle = new Path.Circle(new Point(80, 50), 30);
|
* var circle = new Path.Circle(new Point(80, 50), 30);
|
||||||
*
|
*
|
||||||
* // Create an HSL Color with a hue of 90 degrees, a saturation
|
* // Create an HSL Color with a hue of 90 degrees, a saturation
|
||||||
* // 100% and a lightness of 50%:
|
* // 100% and a lightness of 50%:
|
||||||
* circle.fillColor = { hue: 90, saturation: 1, lightness: 0.5 };
|
* circle.fillColor = { hue: 90, saturation: 1, lightness: 0.5 };
|
||||||
*
|
*
|
||||||
* @example {@paperscript height=200}
|
* @example {@paperscript height=200}
|
||||||
* // Creating a gradient color from an object literal:
|
* // Creating a gradient color from an object literal:
|
||||||
*
|
*
|
||||||
* // Define two points which we will be using to construct
|
* // Define two points which we will be using to construct
|
||||||
* // the path and to position the gradient color:
|
* // the path and to position the gradient color:
|
||||||
* var topLeft = view.center - [80, 80];
|
* var topLeft = view.center - [80, 80];
|
||||||
* var bottomRight = view.center + [80, 80];
|
* var bottomRight = view.center + [80, 80];
|
||||||
*
|
*
|
||||||
* var path = new Path.Rectangle({
|
* var path = new Path.Rectangle({
|
||||||
* topLeft: topLeft,
|
* topLeft: topLeft,
|
||||||
* bottomRight: bottomRight,
|
* bottomRight: bottomRight,
|
||||||
* // Fill the path with a gradient of three color stops
|
* // Fill the path with a gradient of three color stops
|
||||||
* // that runs between the two points we defined earlier:
|
* // that runs between the two points we defined earlier:
|
||||||
* fillColor: {
|
* fillColor: {
|
||||||
* stops: ['yellow', 'red', 'blue'],
|
* stops: ['yellow', 'red', 'blue'],
|
||||||
* origin: topLeft,
|
* origin: topLeft,
|
||||||
* destination: bottomRight
|
* destination: bottomRight
|
||||||
* }
|
* }
|
||||||
* });
|
* });
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Creates a gradient Color object.
|
* Creates a gradient Color object.
|
||||||
*
|
*
|
||||||
|
@ -443,8 +443,8 @@ var Color = Base.extend(new function() {
|
||||||
* // Create a circle shaped path at the center of the view
|
* // Create a circle shaped path at the center of the view
|
||||||
* // with a radius of 80:
|
* // with a radius of 80:
|
||||||
* var path = new Path.Circle({
|
* var path = new Path.Circle({
|
||||||
* center: view.center,
|
* center: view.center,
|
||||||
* radius: 80
|
* radius: 80
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* // The stops array: yellow mixes with red between 0 and 15%,
|
* // The stops array: yellow mixes with red between 0 and 15%,
|
||||||
|
@ -519,8 +519,8 @@ var Color = Base.extend(new function() {
|
||||||
if (values) {
|
if (values) {
|
||||||
if (!type)
|
if (!type)
|
||||||
// type = values.length >= 4
|
// type = values.length >= 4
|
||||||
// ? 'cmyk'
|
// ? 'cmyk'
|
||||||
// : values.length >= 3
|
// : values.length >= 3
|
||||||
type = values.length >= 3
|
type = values.length >= 3
|
||||||
? 'rgb'
|
? 'rgb'
|
||||||
: 'gray';
|
: 'gray';
|
||||||
|
@ -704,9 +704,9 @@ var Color = Base.extend(new function() {
|
||||||
*
|
*
|
||||||
* // Fill the circle with red and give it a 20pt green stroke:
|
* // Fill the circle with red and give it a 20pt green stroke:
|
||||||
* circle.style = {
|
* circle.style = {
|
||||||
* fillColor: 'red',
|
* fillColor: 'red',
|
||||||
* strokeColor: 'green',
|
* strokeColor: 'green',
|
||||||
* strokeWidth: 20
|
* strokeWidth: 20
|
||||||
* };
|
* };
|
||||||
*
|
*
|
||||||
* // Make the stroke half transparent:
|
* // Make the stroke half transparent:
|
||||||
|
@ -891,7 +891,7 @@ var Color = Base.extend(new function() {
|
||||||
* path.fillColor = 'red';
|
* path.fillColor = 'red';
|
||||||
*
|
*
|
||||||
* function onFrame(event) {
|
* function onFrame(event) {
|
||||||
* path.fillColor.hue += 0.5;
|
* path.fillColor.hue += 0.5;
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -954,9 +954,9 @@ var Color = Base.extend(new function() {
|
||||||
* path.fillColor = gradientColor;
|
* path.fillColor = gradientColor;
|
||||||
*
|
*
|
||||||
* function onMouseMove(event) {
|
* function onMouseMove(event) {
|
||||||
* // Set the origin point of the path's gradient color
|
* // Set the origin point of the path's gradient color
|
||||||
* // to the position of the mouse:
|
* // to the position of the mouse:
|
||||||
* path.fillColor.origin = event.point;
|
* path.fillColor.origin = event.point;
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -975,8 +975,8 @@ var Color = Base.extend(new function() {
|
||||||
* // using 40% of the height of the view as its radius
|
* // using 40% of the height of the view as its radius
|
||||||
* // and fill it with a radial gradient color:
|
* // and fill it with a radial gradient color:
|
||||||
* var path = new Path.Circle({
|
* var path = new Path.Circle({
|
||||||
* center: view.center,
|
* center: view.center,
|
||||||
* radius: view.bounds.height * 0.4
|
* radius: view.bounds.height * 0.4
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* var gradient = new Gradient(['yellow', 'red', 'black'], true);
|
* var gradient = new Gradient(['yellow', 'red', 'black'], true);
|
||||||
|
@ -986,9 +986,9 @@ var Color = Base.extend(new function() {
|
||||||
* path.fillColor = gradientColor;
|
* path.fillColor = gradientColor;
|
||||||
*
|
*
|
||||||
* function onMouseMove(event) {
|
* function onMouseMove(event) {
|
||||||
* // Set the origin point of the path's gradient color
|
* // Set the origin point of the path's gradient color
|
||||||
* // to the position of the mouse:
|
* // to the position of the mouse:
|
||||||
* path.fillColor.destination = event.point;
|
* path.fillColor.destination = event.point;
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1004,23 +1004,23 @@ var Color = Base.extend(new function() {
|
||||||
* // using 40% of the height of the view as its radius
|
* // using 40% of the height of the view as its radius
|
||||||
* // and fill it with a radial gradient color:
|
* // and fill it with a radial gradient color:
|
||||||
* var path = new Path.Circle({
|
* var path = new Path.Circle({
|
||||||
* center: view.center,
|
* center: view.center,
|
||||||
* radius: view.bounds.height * 0.4
|
* radius: view.bounds.height * 0.4
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* path.fillColor = {
|
* path.fillColor = {
|
||||||
* gradient: {
|
* gradient: {
|
||||||
* stops: ['yellow', 'red', 'black'],
|
* stops: ['yellow', 'red', 'black'],
|
||||||
* radial: true
|
* radial: true
|
||||||
* },
|
* },
|
||||||
* origin: path.position,
|
* origin: path.position,
|
||||||
* destination: path.bounds.rightCenter
|
* destination: path.bounds.rightCenter
|
||||||
* };
|
* };
|
||||||
*
|
*
|
||||||
* function onMouseMove(event) {
|
* function onMouseMove(event) {
|
||||||
* // Set the origin highlight 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.highlight = event.point;
|
* path.fillColor.highlight = event.point;
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue