Skip to content

fix(ui5-color-picker): ensure RGB and HSL values are within limits #11915

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

hinzzx
Copy link
Contributor

@hinzzx hinzzx commented Jul 15, 2025

Previously if an user was about to type a RGB or HSL value in the input fields, that were out of boundaries (from 0 to 255 for all RGB fields, 0 to 360 for Hue, 0 to 100(%) for Saturation and Light in HSL), the input fields became disabled, which led to bad UX.

With this change we now 'normalise' the values that are out of the bounds (mentioned above) to the closest one.

For RGB:

  • values above 255 –> e.g 275 are normalised to 255;
  • values below 0 –> e.g -20 are normalised to 0;

For HSL:

Hue:

  • values above 360 –> e.g 375 are normalised to 360;
  • values below 0 –> e.g -20 are normlised to 0;

Saturation and Light:

  • values above 100 –> e.g. 120 are normalised to 100;
  • values below 0 –> e.g. -20 are normalised

Before

2025-07-15_11-16-28 (1)

After

2025-07-15_11-14-19 (1)

@hinzzx hinzzx changed the title fix(ui5-color-palette): ensure RGB and HSL values are within limits fix(ui5-color-picker): ensure RGB and HSL values are within limits Jul 15, 2025
Copy link
Contributor

@GDamyanov GDamyanov left a comment

Choose a reason for hiding this comment

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

Comments addressed.
Code looks good.

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.

3 participants