@@ -12,13 +12,6 @@ var CCLScripting = function(workerUrl){
1212 console . warn ( m ) ;
1313 } ;
1414 } ;
15- this . toRGB = function ( number ) {
16- var string = parseInt ( number ) . toString ( 16 ) ;
17- while ( string . length < 6 ) {
18- string = "0" + string ;
19- }
20- return "#" + string ;
21- } ;
2215 this . getWorker = function ( ) {
2316 return new Worker ( this . workerUrl ) ;
2417 } ;
@@ -427,7 +420,13 @@ var CCLScripting = function(workerUrl){
427420 fill :"none" ,
428421 alpha :1
429422 } ;
430-
423+ var toRGB = function ( number ) {
424+ var string = parseInt ( number ) . toString ( 16 ) ;
425+ while ( string . length < 6 ) {
426+ string = "0" + string ;
427+ }
428+ return "#" + string ;
429+ } ;
431430 var applyStroke = function ( p , ref ) {
432431 __ ( p , {
433432 "stroke" : ref . line . color ,
@@ -508,7 +507,7 @@ var CCLScripting = function(workerUrl){
508507 if ( params . length < 3 )
509508 return ;
510509 this . line . width = params [ 0 ] ;
511- this . line . color = CCLScripting . toRGB ( params [ 1 ] ) ;
510+ this . line . color = toRGB ( params [ 1 ] ) ;
512511 this . line . alpha = params [ 2 ] ;
513512 if ( params [ 3 ] ) {
514513 this . line . caps = params [ 3 ] ;
@@ -526,7 +525,7 @@ var CCLScripting = function(workerUrl){
526525 this . beginFill = function ( params ) {
527526 if ( params . length === 0 )
528527 return ;
529- this . fill . fill = CCLScripting . toRGB ( params [ 0 ] ) ;
528+ this . fill . fill = toRGB ( params [ 0 ] ) ;
530529 if ( params . length > 1 ) {
531530 this . fill . alpha = params [ 1 ] ;
532531 }
0 commit comments