I'm trying to find a way to convert from HSL to RGB but I seem to have problems finding the actual algorithm for it.
I found a segment of C++ code but even stranger is that it goes from 0-360 (like I thought it was supposed to do) even though in some editors it seems to cut off at 240.

No, no. The problem is that in game I want to do some somewhat high level icon editing where primarily I have an icon (which I'm not sure is pure white or black) that will then become tinted to be the correct color.

On a related note as to how to draw the icon how would I add multiple shades, like for example the outline of the character would be slightly darker?

You mean at runtime? Well, you can do I.Blend(rgb(0,0,0), ICON_MULTIPLY) to set all of the colours in an icon to black (where I is the /icon to affect). You can then set it to whatever colour by using ICON_ADD. For example, to set it to red: I.Blend(rgb(255,0,0), ICON_ADD).

As for outlines - if you already have an outline on the characters, just use icon.SwapColor() to swap from that colour to the colour you want it to be. If not, you can do an involved series of Blend()s and Shift()s to get an outline. Assuming your existing icon is I, you might do something like this:

<code>var/icon/base=new(I) // Blacken it base.Blend(rgb(0,0,0),ICON_MULTIPLY) // Shift and blend to make an outlined version: var/icon/outline=new(base) outline.Blend(base.Shift(WEST,1)) outline.Blend(base.Shift(EAST,1)) outline.Blend(base.Shift(NORTH,1)) outline.Blend(base.Shift(SOUTH,1)) // Make it whatever colour (I've chosen yellow here) outline.Blend(rgb(255,255,0)) // Put the original icon on top of it outline.Blend(I,ICON_OVERLAY) // (If the above line doesn't work, try ICON_UNDERLAY instead; I'm not quite sure which way around it goes.)</code>

What exactly are you trying to do here, anyway? If you're doing this in a game, be warned that icon operations are CPU-intensive and can generate extra network traffic (to send the resulting icons to the clients when the clients need to be able to see them).

I have a character that is of a skin tone. I want to make it so that he can have varying skin tones along a % range from 0 - 100% where 0 means he's albino white and 100 means pur black. Then there is an outline as well who's luminosity is about 4% more. This would define the outline.