A suspicious bug

There is a web site where you can freely get some C++ code for converting RGB colors to HLS and back. The C++ class called CColor has a method SetRGB and a method SetHLS. Here are the declarations of these methods:

void SetHLS(float hue, float luminance, float saturation);
void SetRGB(int red, int blue, int green);

These two methods can work of course but the latter is badly designed since the order of the three parameters is different from the order of the names Red, Green, Blue in the RGB abbreviation.

The curious fact is that the class declaration has also an enumeration to index the three values of the RGB model, and in this enumeration the red has value 0, the green 1 and the blue 2. There is also a 4 bytes array to convert the COLORREF structure into separate values for red, green and blue, and the members of the COLORREF structure are defined in the normal order: red for the first byte, green for the second and blue in the third.

So why in this method the order of parameters is different ? Is it just a mistake ?
My opinion is that the author of this code has modified intentionally that method to introduce a cause of errors.

This is what happens with the code freely available on the web. People put pieces of code in web sites but at the same time pollute intentionally it with subtle errors because the truth is that they don't want to donate something useful.

A serious team that is going to use that code snippets have to review totally the code, actually recreating it.

This is the reason why we do not provide code for free, because our intention is to provide real solutions to problems, we really want to solve the problems to get the software working well.