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

revisit "color" and "paint" #1135

Open
pixelzoom opened this issue Jan 6, 2021 · 8 comments
Open

revisit "color" and "paint" #1135

pixelzoom opened this issue Jan 6, 2021 · 8 comments

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Jan 6, 2021

This issue caused my to pause and bail while working on phetsims/bamboo#16.

There are a bunch of related "color" issues, most of which are bogged down by the topic of this issue:

#1115,
#948,
phetsims/axon#221,
phetsims/joist#681
...

We have a confusing number of things that are considered "color" or "paint". The ones that I know about are:

null
CSS string
Color
ColorIO
Property(...) // roll your own
ColorProperty
PaintColorProperty
ColorDef
ColorDefIO
PaintDef

... with ColorValue, ColorValueIO, ColorValueProperty recently proposed in #1115 (comment).

And:

  • some promote null to "transparent", other fails with null
  • some have IO types, some don't
  • nothing supports the test for value == null | value instanceof Color | ( typeof value === 'string' && Color.isCSSColorString( value ), some variation of it is duplicated many times

In light of scenery and PhET-iO changes, someone needs to revisit "color" (and perhaps "paint") and come up with a plan for revising and cleaning this up.

Assigning to @ariel-phet to prioritize and assign.

@ariel-phet
Copy link

Labelling as high priority for at least an initial discussion at iO meeting

@zepumph
Copy link
Member

zepumph commented Jan 7, 2021

We brought this up in phet-io meeting today. It was suggested that things may get easier if we stop supporting string in ColorDef and to always use Color. @kathy-phet added this to common code rocks in the quarterly planning doc. Assigning to dev meeting for further discussion after priority is decided on.

@zepumph
Copy link
Member

zepumph commented Jan 7, 2021

It was also mentioned that likely we will want a sub team to tackle this.

@zepumph
Copy link
Member

zepumph commented Jan 7, 2021

@mattpen
Copy link
Contributor

mattpen commented Jan 21, 2021

Removed high priority in discussion at dev meeting

@pixelzoom pixelzoom assigned pixelzoom and unassigned pixelzoom Jan 25, 2021
@samreid
Copy link
Member

samreid commented Feb 11, 2021

Developer Meeting:

We noticed that this is not scheduled as a quarterly goal for Q1 2021. When it becomes a quarterly goal, we will add it back to developer meeting to create a subteam to proceed.

@pixelzoom
Copy link
Contributor Author

As noted in Slack today... It seems like this issue has gotten a tad worse since converting to TypeScript. None of the types listed in #1135 (comment) have gone away. And we've added

  • IColor
  • IPaint
  • PaintColorProperty

... and may be others that I'm not aware of.

Also as noted in Slack by @marlitas, there's currently no support for converting an IColor to a Color. That makes life difficult when you have a parameter or option of type IColor, and you need to apply some Color function, like colorUtilsBrighter.

@samreid
Copy link
Member

samreid commented Jun 26, 2022

2708621 makes Color.toColor accept an IColor argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants