Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Color with ColorRepresentation #627

Merged
merged 1 commit into from
Oct 22, 2023
Merged

Replace Color with ColorRepresentation #627

merged 1 commit into from
Oct 22, 2023

Conversation

puxiao
Copy link
Contributor

@puxiao puxiao commented Oct 11, 2023

Box3Helper.js

class Box3Helper extends LineSegments {
    constructor( box, color = 0xffff00 ) { ... }
}

But ...

new Box3Helper(box3, 0xffff00)

//Error: Argument of type 'number' is not assignable to parameter of type 'Color'.


Color.js

set( r, g, b) {
    if ( g === undefined && b === undefined ) {
        const value = r;
        if ( value && value.isColor ) { 
        } else if ( typeof value === 'number' ) {
        } else if ( typeof value === 'string' ) {
        }
    }
    ...
 }

AxesHelper.js

setColors( xAxisColor, yAxisColor, zAxisColor ) {
    const color = new Color();
    color.set( xAxisColor );
    ...
}

So...

AxesHelper.d.ts

- setColors(xAxisColor: Color ...)
+ setColors(xAxisColor: ColorRepresentation ...)

Copy link
Contributor

@Methuselah96 Methuselah96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Methuselah96 Methuselah96 merged commit 44ab335 into three-types:master Oct 22, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants