Breakdown Colour Hex or RGB Based on Hue

Can somebody figure out this bit of logic for me…

Basically I want to know where these following hues fall on the hex value scale or RGB… So FF3817is red… we know that by looking at it. What if I wanted to have code figure out which Hue it was?

Say Red is all colours between: FF0000 - FF4444 Orange is all hexes between FF4444 - FFB10B Etc. (Those number are not accurate…)

Hues
Red
Yellow
Blue
Green
Orange
Violet
Pink
Brown
Black
Gray

Create the rough between numbers and I got $50 bucks for the person that does it well… let me know before you start…