Skip to content

Commit d63b0c2

Browse files
committed
removed Common.shadeColor
1 parent 2b76c4c commit d63b0c2

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

src/body/Body.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ var Axes = require('../geometry/Axes');
154154

155155
// render properties
156156
var defaultFillStyle = (body.isStatic ? '#2e2b44' : Common.choose(['#006BA6', '#0496FF', '#FFBC42', '#D81159', '#8F2D56'])),
157-
defaultStrokeStyle = Common.shadeColor(defaultFillStyle, -20);
157+
defaultStrokeStyle = '#000';
158158
body.render.fillStyle = body.render.fillStyle || defaultFillStyle;
159159
body.render.strokeStyle = body.render.strokeStyle || defaultStrokeStyle;
160160
body.render.sprite.xOffset += -(body.bounds.min.x - body.position.x) / (body.bounds.max.x - body.bounds.min.x);
@@ -1109,7 +1109,7 @@ var Axes = require('../geometry/Axes');
11091109
*
11101110
* @property render.lineWidth
11111111
* @type number
1112-
* @default 1.5
1112+
* @default 0
11131113
*/
11141114

11151115
/**

src/core/Common.js

-19
Original file line numberDiff line numberDiff line change
@@ -142,25 +142,6 @@ module.exports = Common;
142142
return val;
143143
};
144144

145-
/**
146-
* Returns a hex colour string made by lightening or darkening color by percent.
147-
* @method shadeColor
148-
* @param {string} color
149-
* @param {number} percent
150-
* @return {string} A hex colour
151-
*/
152-
Common.shadeColor = function(color, percent) {
153-
// http://stackoverflow.com/questions/5560248/programmatically-lighten-or-darken-a-hex-color
154-
var colorInteger = parseInt(color.slice(1),16),
155-
amount = Math.round(2.55 * percent),
156-
R = (colorInteger >> 16) + amount,
157-
B = (colorInteger >> 8 & 0x00FF) + amount,
158-
G = (colorInteger & 0x0000FF) + amount;
159-
return "#" + (0x1000000 + (R < 255 ? R < 1 ? 0 : R :255) * 0x10000
160-
+ (B < 255 ? B < 1 ? 0 : B : 255) * 0x100
161-
+ (G < 255 ? G < 1 ? 0 : G : 255)).toString(16).slice(1);
162-
};
163-
164145
/**
165146
* Shuffles the given array in-place.
166147
* The function uses a seeded random generator.

0 commit comments

Comments
 (0)