rem: RColor	color; char	tmp[3]; int		value[4]; int		n; W_ColorPanel	*panel = (W_ColorPanel*)observerData;  value[0] = atoi(WMGetTextFieldText(panel->cmykCyanT)); value[1] = atoi(WMGetTextFieldText(panel->cmykMagentaT)); value[2] = atoi(WMGetTextFieldText(panel->cmykYellowT)); value[3] = atoi(WMGetTextFieldText(panel->cmykBlackT));  for (n=0; n < 4; n++) { if (value[n] > 100) value[n] = 100; if (value[n] < 0) value[n] = 0; }  sprintf(tmp, "%d", value[0]); WMSetTextFieldText(panel->cmykCyanT, tmp); sprintf(tmp, "%d", value[1]); WMSetTextFieldText(panel->cmykMagentaT, tmp); sprintf(tmp, "%d", value[2]); WMSetTextFieldText(panel->cmykYellowT, tmp); sprintf(tmp, "%d", value[3]); WMSetTextFieldText(panel->cmykBlackT, tmp);  WMSetSliderValue(panel->cmykCyanS, value[0]); WMSetSliderValue(panel->cmykMagentaS, value[1]); WMSetSliderValue(panel->cmykYellowS, value[2]); WMSetSliderValue(panel->cmykBlackS, value[3]);  color.red = rint((255.0 - (value[0] * 2.55)) * (1.0 - (value[3] / 100.0))); color.green = rint((255.0 - (value[1] * 2.55)) * (1.0 - (value[3] / 100.0))); color.blue = rint((255.0 - (value[2] * 2.55)) * (1.0 - (value[3] / 100.0)));  WMSetColorPanelColor(panel, color); panel->lastChanged = WMCMYKModeColorPanel;
add: RColor    color; char    tmp[4]; int        value[4]; int        n; W_ColorPanel    *panel = (W_ColorPanel*)observerData;  value[0] = atoi(WMGetTextFieldText(panel->cmykCyanT)); value[1] = atoi(WMGetTextFieldText(panel->cmykMagentaT)); value[2] = atoi(WMGetTextFieldText(panel->cmykYellowT)); value[3] = atoi(WMGetTextFieldText(panel->cmykBlackT));  for (n=0; n < 4; n++) { if (value[n] > 100) value[n] = 100; if (value[n] < 0) value[n] = 0; }  sprintf(tmp, "%d", value[0]); WMSetTextFieldText(panel->cmykCyanT, tmp); sprintf(tmp, "%d", value[1]); WMSetTextFieldText(panel->cmykMagentaT, tmp); sprintf(tmp, "%d", value[2]); WMSetTextFieldText(panel->cmykYellowT, tmp); sprintf(tmp, "%d", value[3]); WMSetTextFieldText(panel->cmykBlackT, tmp);  WMSetSliderValue(panel->cmykCyanS, value[0]); WMSetSliderValue(panel->cmykMagentaS, value[1]); WMSetSliderValue(panel->cmykYellowS, value[2]); WMSetSliderValue(panel->cmykBlackS, value[3]);  color.red = rint((255.0 - (value[0] * 2.55)) * (1.0 - (value[3] / 100.0))); color.green = rint((255.0 - (value[1] * 2.55)) * (1.0 - (value[3] / 100.0))); color.blue = rint((255.0 - (value[2] * 2.55)) * (1.0 - (value[3] / 100.0)));  WMSetColorPanelColor(panel, color); panel->lastChanged = WMCMYKModeColorPanel;
context: cmykTextFieldCallback(void *observerData, WMNotification *notification){	RColor	color;	char	tmp[3];	int		value[4];	int		n;	W_ColorPanel	*panel = (W_ColorPanel*)observerData;	value[0] = atoi(WMGetTextFieldText(panel->cmykCyanT));	value[1] = atoi(WMGetTextFieldText(panel->cmykMagentaT));	value[2] = atoi(WMGetTextFieldText(panel->cmykYellowT));	value[3] = atoi(WMGetTextFieldText(panel->cmykBlackT));	for (n=0; n < 4; n++) {		if (value[n] > 100)			value[n] = 100;		if (value[n] < 0)			value[n] = 0;	}	sprintf(tmp, "%d", value[0]);	WMSetTextFieldText(panel->cmykCyanT, tmp);	sprintf(tmp, "%d", value[1]);	WMSetTextFieldText(panel->cmykMagentaT, tmp);	sprintf(tmp, "%d", value[2]);	WMSetTextFieldText(panel->cmykYellowT, tmp);	sprintf(tmp, "%d", value[3]);	WMSetTextFieldText(panel->cmykBlackT, tmp);	WMSetSliderValue(panel->cmykCyanS, value[0]);	WMSetSliderValue(panel->cmykMagentaS, value[1]);	WMSetSliderValue(panel->cmykYellowS, value[2]);	WMSetSliderValue(panel->cmykBlackS, value[3]);		color.red = rint((255.0 - (value[0] * 2.55)) * (1.0 - (value[3] / 100.0)));	color.green = rint((255.0 - (value[1] * 2.55)) * (1.0 - (value[3] / 100.0)));	color.blue = rint((255.0 - (value[2] * 2.55)) * (1.0 - (value[3] / 100.0)));		WMSetColorPanelColor(panel, color);	panel->lastChanged = WMCMYKModeColorPanel;}