From random color to optimization