Skip to content

Commit

Permalink
update default render theme
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Dec 8, 2020
1 parent 13c7eb5 commit d258411
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions src/body/Body.js
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
};
Expand Down
4 changes: 2 additions & 2 deletions src/render/Render.js
Expand Up @@ -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,
Expand Down

0 comments on commit d258411

Please sign in to comment.