move computeColor() into the public API