Get() returns RGB values while the colorMode is set to HSB

https://p5js.org/reference/#/p5/get

Returns an array of [R,G,B,A] values for any pixel

get(x, y)

Extracts the hue value from a color or pixel array.
Hue exists in both HSB and HSL. This function will return the HSB-normalized hue when supplied with an HSB color object (or when supplied with a pixel array while the color mode is HSB)

I tested this and it works for H and B but did not seem to give correct value for S.

A little exploration lead me to this:
https://github.com/processing/p5.js/issues/4667
https://github.com/processing/p5.js/issues/1620

The above issues also cross link to other related issues if you care to follow those.

One of the posts said this works correctly:
https://bgrins.github.io/TinyColor/

Additional resources:

See references:

  • Color
  • Pixels

See:

  • Color

:)