Refactored how colors are derived