Skip to content

Conversation

@ruthiesun
Copy link

@ruthiesun ruthiesun commented Oct 27, 2025

Summary of the Pull Request

The default CIELab format rounds the values to two decimal places, which is a degree of precision that isn't always needed. This PR adds an optional formatting character (i) to the three CIELab format parameters, which rounds the value to the nearest integer.

PR Checklist

Detailed Description of the Pull Request / Additional comments

In the case where a or b get rounded to -0 (e.g. -0.0001 rounds to -0), the negative sign gets removed. However, I noticed during testing that the default format (rounding to two decimal places) retains the negative sign in these situations (see third screenshot). I can a) revert to keeping the -0 for the new rounding behavior, b) change -0 to 0 for other rounded values, or c) leave it as-is. Also open to suggestions.

I can update the docs as well, if we're happy with the approach.

Validation Steps Performed

  • Settings: Can change the default CIELab format to display rounded values
  • Settings: Can create a custom format with rounded CIELab values
  • Color Picker: Rounded values are displayed when hovering and as a saved color
powertoys-cielab powertoys-cielab-selected powertoys-cielab-selected-0

@ruthiesun
Copy link
Author

@microsoft-github-policy-service agree

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.

Color picker - Lab format: use roundoff optional

1 participant