rem: RColor	color; char	tmp[3]; int		value[3]; int		n; W_ColorPanel	*panel = (W_ColorPanel*)observerData;  value[0] = atoi(WMGetTextFieldText(panel->hsbHueT)); value[1] = atoi(WMGetTextFieldText(panel->hsbSaturationT)); value[2] = atoi(WMGetTextFieldText(panel->hsbBrightnessT));  if (value[0] > 359) value[0] = 359; if (value[0] < 0) value[0] = 0;  for (n=1; n < 3; n++) { if (value[n] > 100) value[n] = 100; if (value[n] < 0) value[n] = 0; }  sprintf(tmp, "%d", value[0]); WMSetTextFieldText(panel->hsbHueT, tmp); sprintf(tmp, "%d", value[1]); WMSetTextFieldText(panel->hsbSaturationT, tmp); sprintf(tmp, "%d", value[2]); WMSetTextFieldText(panel->hsbBrightnessT, tmp);  WMSetSliderValue(panel->hsbHueS, value[0]); WMSetSliderValue(panel->hsbSaturationS, value[1]); WMSetSliderValue(panel->hsbBrightnessS, value[2]);  panel->hsvcolor.hue = value[0]; panel->hsvcolor.saturation = value[1]*2.55; panel->hsvcolor.value = value[2]*2.55;  RHSVtoRGB(&panel->hsvcolor, &color);  panel->lastChanged = WMHSBModeColorPanel; WMSetColorPanelColor(panel, color);  hsbUpdateBrightnessGradient(panel); hsbUpdateSaturationGradient(panel); hsbUpdateHueGradient(panel);
add: RColor    color; char    tmp[4]; int        value[3]; int        n; W_ColorPanel    *panel = (W_ColorPanel*)observerData;  value[0] = atoi(WMGetTextFieldText(panel->hsbHueT)); value[1] = atoi(WMGetTextFieldText(panel->hsbSaturationT)); value[2] = atoi(WMGetTextFieldText(panel->hsbBrightnessT));  if (value[0] > 359) value[0] = 359; if (value[0] < 0) value[0] = 0;  for (n=1; n < 3; n++) { if (value[n] > 100) value[n] = 100; if (value[n] < 0) value[n] = 0; }  sprintf(tmp, "%d", value[0]); WMSetTextFieldText(panel->hsbHueT, tmp); sprintf(tmp, "%d", value[1]); WMSetTextFieldText(panel->hsbSaturationT, tmp); sprintf(tmp, "%d", value[2]); WMSetTextFieldText(panel->hsbBrightnessT, tmp);  WMSetSliderValue(panel->hsbHueS, value[0]); WMSetSliderValue(panel->hsbSaturationS, value[1]); WMSetSliderValue(panel->hsbBrightnessS, value[2]);  panel->hsvcolor.hue = value[0]; panel->hsvcolor.saturation = value[1]*2.55; panel->hsvcolor.value = value[2]*2.55;  RHSVtoRGB(&panel->hsvcolor, &color);  panel->lastChanged = WMHSBModeColorPanel; WMSetColorPanelColor(panel, color);  hsbUpdateBrightnessGradient(panel); hsbUpdateSaturationGradient(panel); hsbUpdateHueGradient(panel);
context: hsbTextFieldCallback(void *observerData, WMNotification *notification){	RColor	color;	char	tmp[3];	int		value[3];	int		n;	W_ColorPanel	*panel = (W_ColorPanel*)observerData;	value[0] = atoi(WMGetTextFieldText(panel->hsbHueT));	value[1] = atoi(WMGetTextFieldText(panel->hsbSaturationT));	value[2] = atoi(WMGetTextFieldText(panel->hsbBrightnessT));		if (value[0] > 359)		value[0] = 359;	if (value[0] < 0)	   value[0] = 0;	for (n=1; n < 3; n++) {		if (value[n] > 100)			value[n] = 100;		if (value[n] < 0)			value[n] = 0;	}	sprintf(tmp, "%d", value[0]);	WMSetTextFieldText(panel->hsbHueT, tmp);	sprintf(tmp, "%d", value[1]);	WMSetTextFieldText(panel->hsbSaturationT, tmp);	sprintf(tmp, "%d", value[2]);	WMSetTextFieldText(panel->hsbBrightnessT, tmp);	WMSetSliderValue(panel->hsbHueS, value[0]);	WMSetSliderValue(panel->hsbSaturationS, value[1]);	WMSetSliderValue(panel->hsbBrightnessS, value[2]);	panel->hsvcolor.hue = value[0];	panel->hsvcolor.saturation = value[1]*2.55;	panel->hsvcolor.value = value[2]*2.55;		RHSVtoRGB(&panel->hsvcolor, &color);	panel->lastChanged = WMHSBModeColorPanel;	WMSetColorPanelColor(panel, color);		hsbUpdateBrightnessGradient(panel);	hsbUpdateSaturationGradient(panel);	hsbUpdateHueGradient(panel);}