Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 452f9bc

Browse files
committed
by default modebar colors contrasts with paper_bgcolor
1 parent f5cc0e9 commit 452f9bc

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/plots/layout_attributes.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,21 +237,18 @@ module.exports = {
237237
bgcolor: {
238238
valType: 'color',
239239
role: 'style',
240-
dflt: 'rgba(255, 255, 255, 0.7)',
241240
editType: 'modebar',
242241
description: 'Sets the background color of the modebar.'
243242
},
244243
color: {
245244
valType: 'color',
246245
role: 'style',
247-
dflt: 'rgba(0, 31, 95, 0.3)',
248246
editType: 'modebar',
249247
description: 'Sets the color of the icons in the modebar.'
250248
},
251249
activecolor: {
252250
valType: 'color',
253251
role: 'style',
254-
dflt: 'rgba(0, 22, 72, 0.5)',
255252
editType: 'modebar',
256253
description: 'Sets the color of the active or hovered on icons in the modebar.'
257254
},

src/plots/plots.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,9 +1335,9 @@ plots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut, formatObj) {
13351335
coerce('datarevision');
13361336

13371337
coerce('modebar.orientation');
1338-
coerce('modebar.bgcolor');
1339-
coerce('modebar.color');
1340-
coerce('modebar.activecolor');
1338+
coerce('modebar.bgcolor', Color.addOpacity(layoutOut.paper_bgcolor, 0.5));
1339+
coerce('modebar.color', Color.contrast(layoutOut.modebar.bgcolor, 30, 30));
1340+
coerce('modebar.activecolor', Color.contrast(layoutOut.modebar.bgcolor));
13411341

13421342
Registry.getComponentMethod(
13431343
'calendars',

0 commit comments

Comments
 (0)