Spraycans use 5 x 72 different datablocks to work for each colour. Each one looks up the colour ID table for its ID (colorSet.txt) and then creates a weaponimage, projectile and three particles for it. With a script it may be possible for the flashlight, but it'd be easier to create a few in a few colours (red, blue, green, white) and check whether your %obj.client.currentColor in WhiteFlashlightImage::onMount is equal to 0, 1 or 2 (red, green, blue) and mount those colours instead, or just no extra code.