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

Color Pickers optionally return Color Objects #55

Closed
1 of 3 tasks
thechriskent opened this issue Apr 25, 2018 · 1 comment
Closed
1 of 3 tasks

Color Pickers optionally return Color Objects #55

thechriskent opened this issue Apr 25, 2018 · 1 comment
Assignees
Milestone

Comments

@thechriskent
Copy link
Contributor

Category

  • Enhancement
  • Bug
  • Question

Desired Behavior

The PropertyFieldColorPicker and the PropertyFieldSwatchColorPicker both return CSS-compatible strings, but it would be nice if they could optionally return an object with more details. This was originally requested by sprider (Issue #52).

By default, both property fields would return strings. However, an optional valueAsObject (boolean) property would be added that, when true, would set the targeted property to an IColor (import { IColor } from 'office-ui-fabric-react/lib/utilities/color';) object instead. The selectedColor property could also be specified as either a string or an IColor object.

The IColor interface returns:

{
  str: string; //CSS-compatible string
  hex: string; //Hex value (does not reflect alpha)
  r: number; //Red
  g: number; //Green
  b: number; //Blue
  h: number; //Hue
  s: number; //Saturation
  v: number; //Value
}

image

@sprider
Copy link

sprider commented Apr 25, 2018

Looks cool Chris. Thank you for considering this change and drafting the requirement on behalf of me.

@estruyf estruyf added this to the v1.5.1 milestone Apr 25, 2018
@estruyf estruyf modified the milestones: v1.5.1, v1.6.0 Apr 30, 2018
@estruyf estruyf mentioned this issue May 8, 2018
@estruyf estruyf closed this as completed May 8, 2018
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

No branches or pull requests

3 participants