Color4.js 424 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { Color } from 'three';
  2. class Color4 extends Color {
  3. constructor( r, g, b, a = 1 ) {
  4. super( r, g, b );
  5. this.a = a;
  6. }
  7. set( r, g, b, a = 1 ) {
  8. this.a = a;
  9. return super.set( r, g, b );
  10. }
  11. copy( color ) {
  12. if ( color.a !== undefined ) this.a = color.a;
  13. return super.copy( color );
  14. }
  15. clone() {
  16. return new this.constructor( this.r, this.g, this.b, this.a );
  17. }
  18. }
  19. export default Color4;