I'm attempting to pick random colors from a specific range on the HSL color wheel. What is the best way to determine if an angular value falls within an angular range on a circle when that range crosses over the $360/0°$ point of the circle?
For example, if I needed to pick a random value between $355°$ and $5°$. So 1 would be an acceptable value in this example, but 180 would not.
Is there an easier/more elegant way to do this other than checking if the value is between $355-360°$ and $0-5°$?
I hope I've understood the question: you want to generate an angle between two angles. You can do it by cases: let $\alpha$ and $\beta$ be the minimum and maximum angles. Let also $\alpha' = \alpha MOD 360$ and $\beta' = \beta MOD 360$. If $\alpha' \lt \beta'$ you just generate a number between the two, otherwise, call $\beta'' = \beta'+360$ (which will be greater than $\alpha'$) and generate a random number between $\alpha'$ and $\beta''$, call it $\gamma$ and then your random angle is $\gamma' = \gamma MOD 360$.
Just a note: in almost all programming languages there is the MOD operator (in C is %) which is used exactly the same as the division, except it returns the remainder of the division. This way you get a random integral angle between two given integral angles.