@@ -963,8 +963,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
963
963
},
964
964
setStrokeColor : function CanvasGraphics_setStrokeColor (/*...*/ ) {
965
965
var cs = this .current .strokeColorSpace ;
966
- var rgbColor = cs .getRgb (arguments );
967
- var color = Util .makeCssRgb (rgbColor [ 0 ], rgbColor [ 1 ], rgbColor [ 2 ] );
966
+ var rgbColor = cs .getRgb (arguments , 0 );
967
+ var color = Util .makeCssRgb (rgbColor );
968
968
this .ctx .strokeStyle = color ;
969
969
this .current .strokeColor = color ;
970
970
},
@@ -976,11 +976,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
976
976
if (base ) {
977
977
var baseComps = base .numComps ;
978
978
979
- color = [] ;
980
- for (var i = 0 ; i < baseComps ; ++i )
981
- color .push (args [i ]);
982
-
983
- color = base .getRgb (color );
979
+ color = base .getRgb (args , 0 );
984
980
}
985
981
var pattern = new TilingPattern (IR , color , this .ctx , this .objs );
986
982
} else if (IR [0 ] == 'RadialAxial' || IR [0 ] == 'Dummy' ) {
@@ -1001,8 +997,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
1001
997
},
1002
998
setFillColor : function CanvasGraphics_setFillColor (/*...*/ ) {
1003
999
var cs = this .current .fillColorSpace ;
1004
- var rgbColor = cs .getRgb (arguments );
1005
- var color = Util .makeCssRgb (rgbColor [ 0 ], rgbColor [ 1 ], rgbColor [ 2 ] );
1000
+ var rgbColor = cs .getRgb (arguments , 0 );
1001
+ var color = Util .makeCssRgb (rgbColor );
1006
1002
this .ctx .fillStyle = color ;
1007
1003
this .current .fillColor = color ;
1008
1004
},
@@ -1019,47 +1015,51 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
1019
1015
if (!(this .current .strokeColorSpace instanceof DeviceGrayCS ))
1020
1016
this .current .strokeColorSpace = new DeviceGrayCS ();
1021
1017
1022
- var color = Util .makeCssRgb (gray , gray , gray );
1018
+ var rgbColor = this .current .strokeColorSpace .getRgb (arguments , 0 );
1019
+ var color = Util .makeCssRgb (rgbColor );
1023
1020
this .ctx .strokeStyle = color ;
1024
1021
this .current .strokeColor = color ;
1025
1022
},
1026
1023
setFillGray : function CanvasGraphics_setFillGray (gray ) {
1027
1024
if (!(this .current .fillColorSpace instanceof DeviceGrayCS ))
1028
1025
this .current .fillColorSpace = new DeviceGrayCS ();
1029
1026
1030
- var color = Util .makeCssRgb (gray , gray , gray );
1027
+ var rgbColor = this .current .fillColorSpace .getRgb (arguments , 0 );
1028
+ var color = Util .makeCssRgb (rgbColor );
1031
1029
this .ctx .fillStyle = color ;
1032
1030
this .current .fillColor = color ;
1033
1031
},
1034
1032
setStrokeRGBColor : function CanvasGraphics_setStrokeRGBColor (r , g , b ) {
1035
1033
if (!(this .current .strokeColorSpace instanceof DeviceRgbCS ))
1036
1034
this .current .strokeColorSpace = new DeviceRgbCS ();
1037
1035
1038
- var color = Util .makeCssRgb (r , g , b );
1036
+ var rgbColor = this .current .strokeColorSpace .getRgb (arguments , 0 );
1037
+ var color = Util .makeCssRgb (rgbColor );
1039
1038
this .ctx .strokeStyle = color ;
1040
1039
this .current .strokeColor = color ;
1041
1040
},
1042
1041
setFillRGBColor : function CanvasGraphics_setFillRGBColor (r , g , b ) {
1043
1042
if (!(this .current .fillColorSpace instanceof DeviceRgbCS ))
1044
1043
this .current .fillColorSpace = new DeviceRgbCS ();
1045
1044
1046
- var color = Util .makeCssRgb (r , g , b );
1045
+ var rgbColor = this .current .fillColorSpace .getRgb (arguments , 0 );
1046
+ var color = Util .makeCssRgb (rgbColor );
1047
1047
this .ctx .fillStyle = color ;
1048
1048
this .current .fillColor = color ;
1049
1049
},
1050
1050
setStrokeCMYKColor : function CanvasGraphics_setStrokeCMYKColor (c , m , y , k ) {
1051
1051
if (!(this .current .strokeColorSpace instanceof DeviceCmykCS ))
1052
1052
this .current .strokeColorSpace = new DeviceCmykCS ();
1053
1053
1054
- var color = Util .makeCssCmyk (c , m , y , k );
1054
+ var color = Util .makeCssCmyk (arguments );
1055
1055
this .ctx .strokeStyle = color ;
1056
1056
this .current .strokeColor = color ;
1057
1057
},
1058
1058
setFillCMYKColor : function CanvasGraphics_setFillCMYKColor (c , m , y , k ) {
1059
1059
if (!(this .current .fillColorSpace instanceof DeviceCmykCS ))
1060
1060
this .current .fillColorSpace = new DeviceCmykCS ();
1061
1061
1062
- var color = Util .makeCssCmyk (c , m , y , k );
1062
+ var color = Util .makeCssCmyk (arguments );
1063
1063
this .ctx .fillStyle = color ;
1064
1064
this .current .fillColor = color ;
1065
1065
},
0 commit comments