This is more of a guide for me rather than anyone else.
Normal colorization in hitcircles and SB objects
It's pretty simple actually. Osu! simply divides the channel. A black image will always be black. A red image can only be some shade of red. You can't start with an orange image and make it blue, since orange is a combination of red and green.
If you take one pixel of an image, say "98,174,200" and colorize it to "255,22,98" the output color will be "98,15,77".
The osu! playfield dim
osu! dims all images in the storyboard and video to be 3/4 of its normal RGB value. Thus, no image in the background can ever be more than 192,192,192 (a completely white image will be this shade of gray while playing) unless you use additive blending.
Whenever you use the storyboard to colorize something, this dimming effect takes place after you colorize, but is still subtracted as if it were the base image.
Let's take a perfectly white image (255,255,255). The dimming property will then subtract out 63 from each channel giving 192,192,192. If you colorize that image to be a very dark gray color (63,63,63), the image when osu dims it will be completely black (0,0,0). During breaks it will be the proper color.
So the equation for the color is like this:
Instead of putting a layer of black in the foreground, colorize each channel from 255 to 63. Just be warned that after you colorize to 63, if there is a break, it will fade in again slightly, so you'll need to colorize it all the way to 0.
Additive coloring
Additive color is slightly different, but works on the same principles. Instead of changing the actual channel's value, it adds that amount to the channel.
Let's say you have a completely white image (255,255,255) and storyboard it to be additive. First, the osu dim reduces it to 192,192,192. Now, that value is added on to each pixel underneath the image, to a maximum of 255,255,255. That means if your background's color is greater than 84,84,84, and you put a white additive layer above it, it will come out to be perfectly white, and not "dimmed" at all.
It uses the same formula as before:
"starbreakadditive" in skin.ini works by colorizing star2.png. The default colorization as far as I can guess is 255,192,192.
Notes
In my opinion, the osu! dim is broken. It shouldn't be calculated based on the original RGB value, but the final output RGB value. This would avoid any exploits with additive blending, and would also fix problems with matching colors to the background.
Normal colorization in hitcircles and SB objects
It's pretty simple actually. Osu! simply divides the channel. A black image will always be black. A red image can only be some shade of red. You can't start with an orange image and make it blue, since orange is a combination of red and green.
If you take one pixel of an image, say "98,174,200" and colorize it to "255,22,98" the output color will be "98,15,77".
Color = Base * SB color / 255
The osu! playfield dim
osu! dims all images in the storyboard and video to be 3/4 of its normal RGB value. Thus, no image in the background can ever be more than 192,192,192 (a completely white image will be this shade of gray while playing) unless you use additive blending.
Whenever you use the storyboard to colorize something, this dimming effect takes place after you colorize, but is still subtracted as if it were the base image.
Let's take a perfectly white image (255,255,255). The dimming property will then subtract out 63 from each channel giving 192,192,192. If you colorize that image to be a very dark gray color (63,63,63), the image when osu dims it will be completely black (0,0,0). During breaks it will be the proper color.
So the equation for the color is like this:
Color = (Base * SB color / 255) - (Base * 1/4)If you're using a white image (255,255,255):
Color= SB color - 63This also can lead to a bit of optimization in storyboarding, should you want to remove a redraw from the SB load and you're fading to black:
Instead of putting a layer of black in the foreground, colorize each channel from 255 to 63. Just be warned that after you colorize to 63, if there is a break, it will fade in again slightly, so you'll need to colorize it all the way to 0.
Additive coloring
Additive color is slightly different, but works on the same principles. Instead of changing the actual channel's value, it adds that amount to the channel.
Let's say you have a completely white image (255,255,255) and storyboard it to be additive. First, the osu dim reduces it to 192,192,192. Now, that value is added on to each pixel underneath the image, to a maximum of 255,255,255. That means if your background's color is greater than 84,84,84, and you put a white additive layer above it, it will come out to be perfectly white, and not "dimmed" at all.
It uses the same formula as before:
Additive Color = (Base * SB color / 255) - (Base * 1/4)
"starbreakadditive" in skin.ini works by colorizing star2.png. The default colorization as far as I can guess is 255,192,192.
Notes
In my opinion, the osu! dim is broken. It shouldn't be calculated based on the original RGB value, but the final output RGB value. This would avoid any exploits with additive blending, and would also fix problems with matching colors to the background.