22
33var isNumeric = require ( 'fast-isnumeric' ) ;
44const svgSdf = require ( 'svg-path-sdf' ) . default ;
5- const { normalize : rgba } = require ( '../../components/color' ) ;
5+ const { normalize : rgba , rgbaString } = require ( '../../components/color' ) ;
66
77var Registry = require ( '../../registry' ) ;
88var Lib = require ( '../../lib' ) ;
@@ -75,7 +75,7 @@ function convertStyle(gd, trace) {
7575 opts . line = {
7676 overlay : true ,
7777 thickness : trace . line . width * plotGlPixelRatio ,
78- color : trace . line . color ,
78+ color : rgbaString ( trace . line . color ) ,
7979 opacity : trace . opacity
8080 } ;
8181
@@ -97,7 +97,7 @@ function convertStyle(gd, trace) {
9797 if ( ! ! trace . fill && trace . fill !== 'none' ) {
9898 opts . fill = {
9999 closed : true ,
100- fill : trace . fillcolor ,
100+ fill : rgbaString ( trace . fillcolor ) ,
101101 thickness : 0
102102 } ;
103103 }
@@ -199,10 +199,10 @@ function convertTextStyle(gd, trace) {
199199 if ( isArrayOrTypedArray ( tfc ) ) {
200200 optsOut . color = new Array ( count ) ;
201201 for ( i = 0 ; i < count ; i ++ ) {
202- optsOut . color [ i ] = tfc [ i ] ;
202+ optsOut . color [ i ] = rgbaString ( tfc [ i ] ) ;
203203 }
204204 } else {
205- optsOut . color = tfc ;
205+ optsOut . color = rgbaString ( tfc ) ;
206206 }
207207
208208 if (
@@ -411,7 +411,7 @@ function convertMarkerSelection(gd, trace, target) {
411411 optsOut = convertMarkerStyle ( gd , Lib . extendFlat ( { } , optsIn , target . marker ) ) ;
412412 } else if ( target . marker ) {
413413 if ( target . marker . size ) optsOut . size = target . marker . size ;
414- if ( target . marker . color ) optsOut . colors = target . marker . color ;
414+ if ( target . marker . color ) optsOut . colors = rgbaString ( target . marker . color ) ;
415415 if ( target . marker . opacity !== undefined ) optsOut . opacity = target . marker . opacity ;
416416 }
417417
@@ -444,11 +444,11 @@ function convertErrorBarStyle(trace, target, plotGlPixelRatio) {
444444 var optsOut = {
445445 capSize : target . width * 2 * plotGlPixelRatio ,
446446 lineWidth : target . thickness * plotGlPixelRatio ,
447- color : target . color
447+ color : rgbaString ( target . color )
448448 } ;
449449
450450 if ( target . copy_ystyle ) {
451- optsOut = trace . error_y ;
451+ optsOut = { ... trace . error_y , color : rgbaString ( trace . error_y . color ) } ;
452452 }
453453
454454 return optsOut ;
0 commit comments