Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Exit

- Home
- Photoshop ecosystem
- Discussions
- Photoshop's RGB to HSB calculation

- Photoshop's RGB to HSB calculation

5

/t5/photoshop-ecosystem-discussions/photoshop-s-rgb-to-hsb-calculation/td-p/14215682
Nov 06, 2023
Nov 06, 2023

Copy link to clipboard

Copied

When I type RGB values or a hex code into Photoshop's color picker, it automatically calculates HSB values. What are the formulas used to calculate the H, S, and B values presented in the color picker tool?

Scott

TOPICS

Windows

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Engaged
,
Jul 29, 2024
Jul 29, 2024

H = IF(180/PI()*ATAN2(2*R-G-B,SQRT(3)*(G-B))<0,180/PI()*ATAN2(2*R-G-B,SQRT(3)*(G-B))+360,180/PI()*ATAN2(2*R-G-B,SQRT(3)*(G-B)))

S=(Max(R,G,B)-Min(R,G,B))/Max(R,G,B)

B=Max(R,G,B)/255

2
Replies
2

/t5/photoshop-ecosystem-discussions/photoshop-s-rgb-to-hsb-calculation/m-p/14217663#M764137
Nov 07, 2023
Nov 07, 2023

Copy link to clipboard

Copied

See this existing thread regarding RGB/HSB calculations:

https://community.adobe.com/t5/photoshop-ecosystem-discussions/calculate-hue-from-rgb/td-p/12603371

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Correct answer by
scotwllm
AUTHOR

Engaged
,

LATEST
/t5/photoshop-ecosystem-discussions/photoshop-s-rgb-to-hsb-calculation/m-p/14768109#M822704
Jul 29, 2024
Jul 29, 2024

Copy link to clipboard

Copied

H = IF(180/PI()*ATAN2(2*R-G-B,SQRT(3)*(G-B))<0,180/PI()*ATAN2(2*R-G-B,SQRT(3)*(G-B))+360,180/PI()*ATAN2(2*R-G-B,SQRT(3)*(G-B)))

S=(Max(R,G,B)-Min(R,G,B))/Max(R,G,B)

B=Max(R,G,B)/255

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Resources

Quick links - Photoshop

Quick links - Photoshop Mobile

Troubleshoot & Learn new things

Copyright © 2024 Adobe. All rights reserved.