気のせいかな?
こんな感じで逃げる。
RGB2HTML : function ( r, g, b ) {
r = '00' + this.dec2hex( r );
g = '00' + this.dec2hex( g );
b = '00' + this.dec2hex( b );
r = r.substr( r.length - 2 );
g = g.substr( g.length - 2 );
b = b.substr( b.length - 2 );
return r + g + b;
},
dec2hex : function ( dec ) {
var hex = "";
while( dec ) {
var last = dec & 15;
hex = String.fromCharCode( ( ( last > 9 ) ? 55 : 48 ) + last ) + hex;
dec >>= 4;
}
return hex;
},
こんな感じで逃げる。
RGB2HTML : function ( r, g, b ) {
r = '00' + this.dec2hex( r );
g = '00' + this.dec2hex( g );
b = '00' + this.dec2hex( b );
r = r.substr( r.length - 2 );
g = g.substr( g.length - 2 );
b = b.substr( b.length - 2 );
return r + g + b;
},
dec2hex : function ( dec ) {
var hex = "";
while( dec ) {
var last = dec & 15;
hex = String.fromCharCode( ( ( last > 9 ) ? 55 : 48 ) + last ) + hex;
dec >>= 4;
}
return hex;
},
コメントする