|
@@ -242,24 +242,17 @@ class Color {
|
|
|
if ( size === 3 ) {
|
|
|
|
|
|
// #ff0
|
|
|
- this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 0 ), 16 ) / 255;
|
|
|
- this.g = parseInt( hex.charAt( 1 ) + hex.charAt( 1 ), 16 ) / 255;
|
|
|
- this.b = parseInt( hex.charAt( 2 ) + hex.charAt( 2 ), 16 ) / 255;
|
|
|
-
|
|
|
- ColorManagement.toWorkingColorSpace( this, colorSpace );
|
|
|
-
|
|
|
- return this;
|
|
|
+ return this.setRGB(
|
|
|
+ parseInt( hex.charAt( 0 ), 16 ) / 15,
|
|
|
+ parseInt( hex.charAt( 1 ), 16 ) / 15,
|
|
|
+ parseInt( hex.charAt( 2 ), 16 ) / 15,
|
|
|
+ colorSpace
|
|
|
+ );
|
|
|
|
|
|
} else if ( size === 6 ) {
|
|
|
|
|
|
// #ff0000
|
|
|
- this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 1 ), 16 ) / 255;
|
|
|
- this.g = parseInt( hex.charAt( 2 ) + hex.charAt( 3 ), 16 ) / 255;
|
|
|
- this.b = parseInt( hex.charAt( 4 ) + hex.charAt( 5 ), 16 ) / 255;
|
|
|
-
|
|
|
- ColorManagement.toWorkingColorSpace( this, colorSpace );
|
|
|
-
|
|
|
- return this;
|
|
|
+ return this.setHex( parseInt( hex, 16 ), colorSpace );
|
|
|
|
|
|
} else {
|
|
|
|