calculation logic for lamp colors on server side complete