File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -404,6 +404,11 @@ function opaqueSetBackground(gd, bgColor) {
404
404
setBackground ( gd , bgColor ) ;
405
405
}
406
406
407
+ function blendSetBackground ( gd , bgColor ) {
408
+ var blend = Color . combine ( bgColor , 'white' ) ;
409
+ setBackground ( gd , blend ) ;
410
+ }
411
+
407
412
function setPlotContext ( gd , config ) {
408
413
if ( ! gd . _context ) gd . _context = Lib . extendDeep ( { } , Plotly . defaultConfig ) ;
409
414
var context = gd . _context ;
@@ -416,10 +421,15 @@ function setPlotContext(gd, config) {
416
421
key = keys [ i ] ;
417
422
if ( key === 'editable' || key === 'edits' ) continue ;
418
423
if ( key in context ) {
419
- if ( key === 'setBackground' && config [ key ] === 'opaque' ) {
420
- context [ key ] = opaqueSetBackground ;
424
+ if ( key === 'setBackground' ) {
425
+ if ( config [ key ] === 'opaque' ) {
426
+ context [ key ] = opaqueSetBackground ;
427
+ } else if ( config [ key ] === 'blend' ) {
428
+ context [ key ] = blendSetBackground ;
429
+ }
430
+ } else {
431
+ context [ key ] = config [ key ] ;
421
432
}
422
- else context [ key ] = config [ key ] ;
423
433
}
424
434
}
425
435
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ module.exports = {
108
108
109
109
// function to add the background color to a different container
110
110
// or 'opaque' to ensure there's white behind it,
111
+ // or 'blend' to blend bg color with white,
111
112
// or any other custom function of gd
112
113
setBackground : 'transparent' ,
113
114
You can’t perform that action at this time.
0 commit comments