Brightness, Luminosity and Brightness are not the same thing. The HSL color model would be useful if one of the components were L (luminosity).
Brightness is not something you need to take care of according to your requirement. read the discussion link:
http://www.cambridgeincolour.com/forums/thread23366.htm
RED (# FF0000) has a brightness of 50% at 100% saturation, but the software programs we use slightly adjust the values ββto take into account perceptual factors.
You need to start with pure colors. Pure colors are colors in the HSL color space that have a brightness of 50% and a saturation of 100%, and changing the hue value gives you pure colors. In total, 6 * 60 colors are available, available through HSL / RGB color spaces. those. if you summarize the colors generated using the combinations below, you get 360 pure colors.
R = 255 * (x / 60), G = 0, B = 255; where x varies from 0 to 60 R = 255 * (x / 60), G = 255, B = 0; where x varies from 0 to 60
R = 255, G = 255 * (x / 60), B = 0; where x varies from 0 to 60 R = 0, G = 255 * (x / 60), B = 255; where x varies from 0 to 60
R = 255, G = 0, B = 255 * (x / 60); where x varies from 0 to 60 R = 0, G = 255, B = 255 * (x / 60); where x varies from 0 to 60
leave all the colors that we see, manipulate the saturation and brightness.
Now, to get grayscale images:
1 - You can use the brightness formula proposed by Jerry (there are other formulas to improve performance). 2 - You can change the saturation to 0% in the HSL color space, which corresponds to http://www.workwithcolor.com/hsl-color-schemer-01.htm .