Skip to content

Commit

Permalink
use 'input' for auto update, get rid of hex from stateObject, and s…
Browse files Browse the repository at this point in the history
…tudio to use Color.js for wrapper-side serialization, phetsims/fourier-making-waves#13 phetsims/scenery-phet#515
  • Loading branch information
zepumph committed Nov 13, 2020
1 parent c133ce1 commit 448166c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions js/util/Color.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,7 @@ class Color {
r: this.r,
g: this.g,
b: this.b,
a: this.a,
hex: this.toHexString()
a: this.a
};
}

Expand Down Expand Up @@ -1087,9 +1086,7 @@ Color.ColorIO = new IOType( 'ColorIO', {
valueType: Color,
documentation: 'A color, with rgba',
toStateObject: color => color.toStateObject(),
fromStateObject: stateObject => {
return stateObject.hex ? new Color( stateObject.hex ) : new Color( stateObject.r, stateObject.g, stateObject.b, stateObject.a );
}
fromStateObject: stateObject => new Color( stateObject.r, stateObject.g, stateObject.b, stateObject.a )
} );

export default Color;

0 comments on commit 448166c

Please sign in to comment.