adding color calculation helper