Skip to content

Conversation

@tsanislavgatev
Copy link
Contributor

@tsanislavgatev tsanislavgatev commented Nov 28, 2024

Now both of the sliders have tootip showing the value selected.

fixes: #10203

@tsanislavgatev tsanislavgatev requested a review from unazko December 3, 2024 08:13
Copy link
Contributor

@unazko unazko left a comment

Choose a reason for hiding this comment

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

Tooltips are present and with accurate values.

@tsanislavgatev tsanislavgatev merged commit 06a5fdb into main Dec 10, 2024
10 checks passed
@tsanislavgatev tsanislavgatev deleted the color-picker-tooltips branch December 10, 2024 11:45

_setMainColor(hueValue: number) {
if (hueValue <= 255) {
const hueValueMod = hueValue * 4.251;
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually, assigning to a new variable (hueValueMod) and using it throughout the function, is necessary when you need both the passed param (hueValue) and the modified one (hueValueMod) at the same time. But if you'll only use the modified one, the best would be to just have: hueValue = hueValue * 4.251; and continue using hueValue in the function as before.


_setMainColor(hueValue: number) {
if (hueValue <= 255) {
const hueValueMod = hueValue * 4.251;
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this magic number existed before, but this refactoring is an opportunity to set it to a constant.

// By using the selected coordinates(x = Lightness, y = Saturation) and hue(selected from the hue slider)
// and HSL format, the color will be parsed to RGB
// 0 ≤ H < 360
// 4.251 because with 4.25 we get out of the colors range.
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment is now obsolete and should be deleted not to cause confusion.

@ui5-webcomponents-bot
Copy link
Collaborator

🎉 This PR is included in version v2.6.0-rc.0 🎉

The release is available on v2.6.0-rc.0

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ui5-color-picker]: missing tooltip for slider and alpha slider

5 participants