Skip to content

Functional style formatter. Color range is all float numb… - #34001

Merged
Peng Lyu (rebornix) merged 3 commits into
microsoft:masterfrom
rebornix:ColorPickerFormatter
Sep 9, 2017
Merged

Peng Lyu (rebornix) merged 3 commits into
microsoft:masterfrom
rebornix:ColorPickerFormatter

Conversation

@rebornix

Copy link
Copy Markdown
Contributor

Fix #32235.

Per discussion points in #32235

  • Color value ranges. Now we only expose float number between 0...1 .
  • Color.fromHex, Color.fromHSL are removed from the API.
  • Color Insertion. This is not done, but it's not a blocker to the API finalization.

With the new API,

  • The title of Color Picker only shows four color format, RGB, HEX, HSL, HSA, which are representatives of RGB color model. When users click on it, we iterate through them.
  • When users move the cursor inside the saturation box, we only make updates to the document when mouse up.
  • Since we only make changes when the color is finalized (mouse up), we ask the provider for string representative of selected color. We don't flood the extensions of both API call or content change.
  • Extensions format the color per Color Format users select in the color picker.

For now, the four formats are good enough as long as we are only targeting RGB color model. If there is other feature request, we need to update both provideColorRange and resolveColor as the color can no longer be represented as RGB. cc João Moreno (@joaomoreno) Johannes Rieken (@jrieken)

@rebornix

Copy link
Copy Markdown
Contributor Author

Aligned the API name with other providers, now it works the same way as before and our API surface is based on RGB color model. Extensions do the parsing and resolving.

@rebornix
Peng Lyu (rebornix) merged commit 3481343 into microsoft:master Sep 9, 2017
@joaomoreno

Copy link
Copy Markdown
Contributor

Good job!

@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Color Picker: Finalize Color Picker API

3 participants