Recently rediscovered this post from several years ago. Needing to calculate the White value for a color to drive lighting fixtures that expect RGBW channels is pretty common. Since it's basic color math, it's something that's really best done in a shader. The included component is just the shader, updated from the original with current best practices for GLSL in TD applied, and wrapped in a baseCOMP for portability.
To use it you'll want to feed it a TOP with your source image into it. The shader writes the White channel values to the Alpha channel. Taking the output into a TOPtoCHOP should be all that's necessary, but you may want to rename the 'a' channel to 'w' just for sanity's sake.