From d63b0c25c807d841ea33fad6f3060252dca89c96 Mon Sep 17 00:00:00 2001 From: liabru Date: Tue, 9 May 2017 00:40:16 +0100 Subject: [PATCH] removed Common.shadeColor --- src/body/Body.js | 4 ++-- src/core/Common.js | 19 ------------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/src/body/Body.js b/src/body/Body.js index fb0e0dd..271413c 100644 --- a/src/body/Body.js +++ b/src/body/Body.js @@ -154,7 +154,7 @@ var Axes = require('../geometry/Axes'); // render properties var defaultFillStyle = (body.isStatic ? '#2e2b44' : Common.choose(['#006BA6', '#0496FF', '#FFBC42', '#D81159', '#8F2D56'])), - defaultStrokeStyle = Common.shadeColor(defaultFillStyle, -20); + defaultStrokeStyle = '#000'; body.render.fillStyle = body.render.fillStyle || defaultFillStyle; body.render.strokeStyle = body.render.strokeStyle || defaultStrokeStyle; 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'); * * @property render.lineWidth * @type number - * @default 1.5 + * @default 0 */ /** diff --git a/src/core/Common.js b/src/core/Common.js index 3fa193e..681a53f 100644 --- a/src/core/Common.js +++ b/src/core/Common.js @@ -142,25 +142,6 @@ module.exports = Common; return val; }; - /** - * Returns a hex colour string made by lightening or darkening color by percent. - * @method shadeColor - * @param {string} color - * @param {number} percent - * @return {string} A hex colour - */ - Common.shadeColor = function(color, percent) { - // http://stackoverflow.com/questions/5560248/programmatically-lighten-or-darken-a-hex-color - var colorInteger = parseInt(color.slice(1),16), - amount = Math.round(2.55 * percent), - R = (colorInteger >> 16) + amount, - B = (colorInteger >> 8 & 0x00FF) + amount, - G = (colorInteger & 0x0000FF) + amount; - return "#" + (0x1000000 + (R < 255 ? R < 1 ? 0 : R :255) * 0x10000 - + (B < 255 ? B < 1 ? 0 : B : 255) * 0x100 - + (G < 255 ? G < 1 ? 0 : G : 255)).toString(16).slice(1); - }; - /** * Shuffles the given array in-place. * The function uses a seeded random generator.