int
randr_set_temperature(randr_state_t *state,
		      const color_setting_t *setting)
{
	int r;

	/* If no CRTC number has been specified,
	   set temperature on all CRTCs. */
	if (state->crtc_num < 0) {
		for (int i = 0; i < state->crtc_count; i++) {
			r = randr_set_temperature_for_crtc(state, i,
							   setting);
			if (r < 0) return -1;
		}
	} else {
		return randr_set_temperature_for_crtc(state, state->crtc_num,
						      setting);
	}

	return 0;
}
int
randr_set_temperature(randr_state_t *state, int temp, float brightness,
		      float gamma[3])
{
	int r;

	/* If no CRTC number has been specified,
	   set temperature on all CRTCs. */
	if (state->crtc_num < 0) {
		for (int i = 0; i < state->crtc_count; i++) {
			r = randr_set_temperature_for_crtc(state, i,
							   temp, brightness,
							   gamma);
			if (r < 0) return -1;
		}
	} else {
		return randr_set_temperature_for_crtc(state, state->crtc_num,
						      temp, brightness, gamma);
	}

	return 0;
}