Cleaned up colorization: use function + rectangle