From 452f9bc6ffe78b51f2b393182d3cbffafd16a13e Mon Sep 17 00:00:00 2001 From: Antoine Roy-Gobeil Date: Fri, 5 Oct 2018 12:02:45 -0400 Subject: [PATCH] by default modebar colors contrasts with paper_bgcolor --- src/plots/layout_attributes.js | 3 --- src/plots/plots.js | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/plots/layout_attributes.js b/src/plots/layout_attributes.js index bbb48187b45..103a0b234f7 100644 --- a/src/plots/layout_attributes.js +++ b/src/plots/layout_attributes.js @@ -237,21 +237,18 @@ module.exports = { bgcolor: { valType: 'color', role: 'style', - dflt: 'rgba(255, 255, 255, 0.7)', editType: 'modebar', description: 'Sets the background color of the modebar.' }, color: { valType: 'color', role: 'style', - dflt: 'rgba(0, 31, 95, 0.3)', editType: 'modebar', description: 'Sets the color of the icons in the modebar.' }, activecolor: { valType: 'color', role: 'style', - dflt: 'rgba(0, 22, 72, 0.5)', editType: 'modebar', description: 'Sets the color of the active or hovered on icons in the modebar.' }, diff --git a/src/plots/plots.js b/src/plots/plots.js index 3b52c87512a..a891210877d 100644 --- a/src/plots/plots.js +++ b/src/plots/plots.js @@ -1335,9 +1335,9 @@ plots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut, formatObj) { coerce('datarevision'); coerce('modebar.orientation'); - coerce('modebar.bgcolor'); - coerce('modebar.color'); - coerce('modebar.activecolor'); + coerce('modebar.bgcolor', Color.addOpacity(layoutOut.paper_bgcolor, 0.5)); + coerce('modebar.color', Color.contrast(layoutOut.modebar.bgcolor, 30, 30)); + coerce('modebar.activecolor', Color.contrast(layoutOut.modebar.bgcolor)); Registry.getComponentMethod( 'calendars',