Ejemplo n.º 1
0
void
APRView::SetCurrentColor(rgb_color color)
{
	fCurrentSet.SetColor(fWhich, color);
	set_ui_color(fWhich, color);
	UpdateControls();
}
Ejemplo n.º 2
0
void
APRView::UpdateAllColors()
{
	for (int32 i = 0; i < color_description_count(); i++) {
		color_which which = get_color_description(i)->which; 
		rgb_color color = fCurrentSet.GetColor(which);
		set_ui_color(which, color);
	}
}
Ejemplo n.º 3
0
void
APRView::_UpdateAllColors()
{
	for (int32 i = color_description_count() - 1; i >= 0; i--) {
		color_which which = get_color_description(i)->which;
		rgb_color color = fCurrentSet.GetColor(which);
		set_ui_color(which, color);
		static_cast<ColorWhichItem*>(fAttrList->ItemAt(i))->SetColor(color);
		fAttrList->InvalidateItem(i);
	}
}
Ejemplo n.º 4
0
void
APRView::_SetCurrentColor(rgb_color color)
{
	set_ui_color(fWhich, color);
	fCurrentColors.SetColor(ui_color_name(fWhich), color);

	int32 currentIndex = fAttrList->CurrentSelection();
	ColorWhichItem* item = (ColorWhichItem*)fAttrList->ItemAt(currentIndex);
	if (item != NULL) {
		item->SetColor(color);
		fAttrList->InvalidateItem(currentIndex);
	}

	fPicker->SetValue(color);
	fColorPreview->SetColor(color);
	fColorPreview->Invalidate();
}
Ejemplo n.º 5
0
static int
UpdateUIColor(color_which which, const char *str)
{
	rgb_color color;
	unsigned int r, g, b;
	if (which < 0)
		return -1;
	// parse
	if (!str || !str[0])
		return -1;
	if (str[0] == '#')
		str++;
	if (sscanf(str, "%02x%02x%02x", &r, &g, &b) < 3)
		return -1;
	color.red = r;
	color.green = g;
	color.blue = b;
	color.alpha = 255;
	//printf("setting %d to {%d, %d, %d, %d}\n", which, r, g, b, 255);
	set_ui_color(which, color);
	return B_OK;
}