From d258411faac2f19522b365f4319abaaf16f5ba31 Mon Sep 17 00:00:00 2001 From: liabru Date: Tue, 8 Dec 2020 23:14:20 +0000 Subject: [PATCH] update default render theme --- src/body/Body.js | 12 ++++++++---- src/render/Render.js | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/body/Body.js b/src/body/Body.js index f38d2c8e..3bdc75cf 100644 --- a/src/body/Body.js +++ b/src/body/Body.js @@ -75,13 +75,15 @@ var Axes = require('../geometry/Axes'); render: { visible: true, opacity: 1, + strokeStyle: null, + fillStyle: null, + lineWidth: null, sprite: { xScale: 1, yScale: 1, xOffset: 0, yOffset: 0 - }, - lineWidth: 0 + } }, events: null, bounds: null, @@ -165,10 +167,12 @@ var Axes = require('../geometry/Axes'); }); // render properties - var defaultFillStyle = (body.isStatic ? '#2e2b44' : Common.choose(['#006BA6', '#0496FF', '#FFBC42', '#D81159', '#8F2D56'])), - defaultStrokeStyle = '#000'; + var defaultFillStyle = (body.isStatic ? '#14151f' : Common.choose(['#f19648', '#f5d259', '#f55a3c', '#063e7b', '#ececd1'])), + defaultStrokeStyle = body.isStatic ? '#555' : '#ccc', + defaultLineWidth = body.isStatic && body.render.fillStyle === null ? 1 : 0; body.render.fillStyle = body.render.fillStyle || defaultFillStyle; body.render.strokeStyle = body.render.strokeStyle || defaultStrokeStyle; + body.render.lineWidth = body.render.lineWidth || defaultLineWidth; body.render.sprite.xOffset += -(body.bounds.min.x - body.position.x) / (body.bounds.max.x - body.bounds.min.x); body.render.sprite.yOffset += -(body.bounds.min.y - body.position.y) / (body.bounds.max.y - body.bounds.min.y); }; diff --git a/src/render/Render.js b/src/render/Render.js index f3f4ef20..700f53a5 100644 --- a/src/render/Render.js +++ b/src/render/Render.js @@ -52,8 +52,8 @@ var Mouse = require('../core/Mouse'); width: 800, height: 600, pixelRatio: 1, - background: '#18181d', - wireframeBackground: '#0f0f13', + background: '#14151f', + wireframeBackground: '#14151f', hasBounds: !!options.bounds, enabled: true, wireframes: true,