Esempio n. 1
0
static void
html_get_back_color (GnmStyle const *style, guint *r, guint *g, guint *b)
{
	GnmColor const *color = gnm_style_get_back_color (style);
	*r = GO_COLOR_UINT_R (color->go_color);
	*g = GO_COLOR_UINT_G (color->go_color);
	*b = GO_COLOR_UINT_B (color->go_color);
}
Esempio n. 2
0
static void
html_get_text_color (GnmCell *cell, GnmStyle const *style, guint *r, guint *g, guint *b)
{
	GOColor fore = gnm_cell_get_render_color (cell);

	if (fore == 0)
		*r = *g = *b = 0;
	else {
		*r = GO_COLOR_UINT_R (fore);
		*g = GO_COLOR_UINT_G (fore);
		*b = GO_COLOR_UINT_B (fore);
	}
}
Esempio n. 3
0
int gnumeric_sheet_get_cell_font_color(GnumericSheetPtr sheet, int x, int y,
				       int *r16, int *g16, int *b16) {
  GnmCell *cell = sheet_cell_get((Sheet*)sheet,x,y);
  if (cell==NULL) {
    return 1;
  }
  GOColor c = gnm_cell_get_render_color(cell);
  if (!c) {
    *r16 = *g16 = *b16 = 0;
  } else {
      *r16 = GO_COLOR_UINT_R(c);
      *g16 = GO_COLOR_UINT_G(c);
      *b16 = GO_COLOR_UINT_B(c);
  }
  return 0;
}
Esempio n. 4
0
static char *
html_get_border_style (GnmBorder *border)
{
	GString *text = g_string_new (NULL);
	char *result;

	switch (border->line_type) {
	case GNM_STYLE_BORDER_THIN:
		g_string_append (text, "thin solid");
		break;
	case GNM_STYLE_BORDER_MEDIUM:
		g_string_append (text, "medium solid");
		break;
	case GNM_STYLE_BORDER_DASHED:
		g_string_append (text, "thin dashed");
		break;
	case GNM_STYLE_BORDER_DOTTED:
		g_string_append (text, "thin dotted");
		break;
	case GNM_STYLE_BORDER_THICK:
		g_string_append (text, "thick solid");
		break;
	case GNM_STYLE_BORDER_DOUBLE:
		g_string_append (text, "thick double");
		break;
	case GNM_STYLE_BORDER_HAIR:
		g_string_append (text, "0.5pt solid");
		break;
	case GNM_STYLE_BORDER_MEDIUM_DASH:
		g_string_append (text, "medium dashed");
		break;
	case GNM_STYLE_BORDER_DASH_DOT:
		g_string_append (text, "thin dashed");
		break;
	case GNM_STYLE_BORDER_MEDIUM_DASH_DOT:
		g_string_append (text, "medium dashed");
		break;
	case GNM_STYLE_BORDER_DASH_DOT_DOT:
		g_string_append (text, "thin dotted");
		break;
	case GNM_STYLE_BORDER_MEDIUM_DASH_DOT_DOT:
		g_string_append (text, "medium dotted");
		break;
	case GNM_STYLE_BORDER_SLANTED_DASH_DOT:
		g_string_append (text, "thin dashed");
		break;
	default:
		break;
	}

	if (border->color) {
		guint r, g, b;
		r = GO_COLOR_UINT_R (border->color->go_color);
		g = GO_COLOR_UINT_G (border->color->go_color);
		b = GO_COLOR_UINT_B (border->color->go_color);
		g_string_append_printf (text, " #%02X%02X%02X", r, g, b);
	}

	result = text->str;
	g_string_free (text, FALSE);
	return result;
}