Skip to main content
Geppetto Luis
Legend
November 17, 2018
Answered

alert value h s b

  • November 17, 2018
  • 1 reply
  • 484 views

I would like a warning window if possible

with the values H S B

as shown.

Color-Picker-Foreground-Color-2018-11-17-21-40-51.jpg

This topic has been closed for replies.
Correct answer pixxxelschubser

I hope that I understand you right:

you want to open the color picker and gets the hsb value of this color?

If so, try this:

app.showColorPicker();

var col = app.foregroundColor.hsb;

alert(col.hue);

alert(col.saturation);

alert(col.brightness);

hsb.hue + hsb. saturation + hsb.brightness

Have fun

1 reply

pixxxelschubser
Community Expert
pixxxelschubserCommunity ExpertCorrect answer
Community Expert
November 17, 2018

I hope that I understand you right:

you want to open the color picker and gets the hsb value of this color?

If so, try this:

app.showColorPicker();

var col = app.foregroundColor.hsb;

alert(col.hue);

alert(col.saturation);

alert(col.brightness);

hsb.hue + hsb. saturation + hsb.brightness

Have fun

Geppetto Luis
Legend
November 18, 2018

Just what I needed

a question

I would like to display only the figures before the point

can the figures be deleted later?

pixxxelschubser
Community Expert
Community Expert
November 18, 2018

Try

alert(Math.round(col.hue));

or

alert(Math.ceil(col.hue));

What you need.