Added display of hex triplets for HTML people

-Yosh
This commit is contained in:
Manish Singh 1998-03-13 08:53:33 +00:00
parent 382eb47914
commit 591abe973e
3 changed files with 27 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Fri Mar 13 00:51:37 PST 1998 Manish Singh <yosh@gimp.org>
* app/color_picker.c: added display of hex triplets for HTML
people
Thu Mar 12 18:51:09 PST 1998 Manish Singh <yosh@gimp.org>
* app/gdisplay.c

View File

@ -59,6 +59,7 @@ static char blue_buf [MAX_INFO_BUF];
static char alpha_buf [MAX_INFO_BUF];
static char index_buf [MAX_INFO_BUF];
static char gray_buf [MAX_INFO_BUF];
static char hex_buf [MAX_INFO_BUF];
typedef struct _ColorPickerOptions ColorPickerOptions;
struct _ColorPickerOptions
@ -155,6 +156,7 @@ color_picker_button_press (Tool *tool,
info_dialog_add_field (color_picker_info, "Green", green_buf);
info_dialog_add_field (color_picker_info, "Blue", blue_buf);
info_dialog_add_field (color_picker_info, "Alpha", alpha_buf);
info_dialog_add_field (color_picker_info, "Hex Triplet", hex_buf);
break;
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
@ -163,11 +165,13 @@ color_picker_button_press (Tool *tool,
info_dialog_add_field (color_picker_info, "Red", red_buf);
info_dialog_add_field (color_picker_info, "Green", green_buf);
info_dialog_add_field (color_picker_info, "Blue", blue_buf);
info_dialog_add_field (color_picker_info, "Hex Triplet", hex_buf);
break;
case GRAY_GIMAGE: case GRAYA_GIMAGE:
info_dialog_add_field (color_picker_info, "Intensity", gray_buf);
info_dialog_add_field (color_picker_info, "Alpha", alpha_buf);
info_dialog_add_field (color_picker_info, "Hex Triplet", hex_buf);
break;
default :
@ -384,6 +388,7 @@ color_picker_info_update (Tool *tool,
sprintf (alpha_buf, "N/A");
sprintf (index_buf, "N/A");
sprintf (gray_buf, "N/A");
sprintf (hex_buf, "N/A");
}
else
{
@ -397,6 +402,8 @@ color_picker_info_update (Tool *tool,
sprintf (alpha_buf, "%d", col_value [ALPHA_PIX]);
else
sprintf (alpha_buf, "N/A");
sprintf (hex_buf, "#%.2x%.2x%.2x", col_value [RED_PIX],
col_value [GREEN_PIX], col_value [BLUE_PIX]);
break;
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
@ -408,6 +415,8 @@ color_picker_info_update (Tool *tool,
sprintf (red_buf, "%d", col_value [RED_PIX]);
sprintf (green_buf, "%d", col_value [GREEN_PIX]);
sprintf (blue_buf, "%d", col_value [BLUE_PIX]);
sprintf (hex_buf, "#%.2x%.2x%.2x", col_value [RED_PIX],
col_value [GREEN_PIX], col_value [BLUE_PIX]);
break;
case GRAY_GIMAGE: case GRAYA_GIMAGE:
@ -416,6 +425,8 @@ color_picker_info_update (Tool *tool,
sprintf (alpha_buf, "%d", col_value [ALPHA_PIX]);
else
sprintf (alpha_buf, "N/A");
sprintf (hex_buf, "#%.2x%.2x%.2x", col_value [GRAY_PIX],
col_value [GRAY_PIX], col_value [GRAY_PIX]);
break;
}
}

View File

@ -59,6 +59,7 @@ static char blue_buf [MAX_INFO_BUF];
static char alpha_buf [MAX_INFO_BUF];
static char index_buf [MAX_INFO_BUF];
static char gray_buf [MAX_INFO_BUF];
static char hex_buf [MAX_INFO_BUF];
typedef struct _ColorPickerOptions ColorPickerOptions;
struct _ColorPickerOptions
@ -155,6 +156,7 @@ color_picker_button_press (Tool *tool,
info_dialog_add_field (color_picker_info, "Green", green_buf);
info_dialog_add_field (color_picker_info, "Blue", blue_buf);
info_dialog_add_field (color_picker_info, "Alpha", alpha_buf);
info_dialog_add_field (color_picker_info, "Hex Triplet", hex_buf);
break;
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
@ -163,11 +165,13 @@ color_picker_button_press (Tool *tool,
info_dialog_add_field (color_picker_info, "Red", red_buf);
info_dialog_add_field (color_picker_info, "Green", green_buf);
info_dialog_add_field (color_picker_info, "Blue", blue_buf);
info_dialog_add_field (color_picker_info, "Hex Triplet", hex_buf);
break;
case GRAY_GIMAGE: case GRAYA_GIMAGE:
info_dialog_add_field (color_picker_info, "Intensity", gray_buf);
info_dialog_add_field (color_picker_info, "Alpha", alpha_buf);
info_dialog_add_field (color_picker_info, "Hex Triplet", hex_buf);
break;
default :
@ -384,6 +388,7 @@ color_picker_info_update (Tool *tool,
sprintf (alpha_buf, "N/A");
sprintf (index_buf, "N/A");
sprintf (gray_buf, "N/A");
sprintf (hex_buf, "N/A");
}
else
{
@ -397,6 +402,8 @@ color_picker_info_update (Tool *tool,
sprintf (alpha_buf, "%d", col_value [ALPHA_PIX]);
else
sprintf (alpha_buf, "N/A");
sprintf (hex_buf, "#%.2x%.2x%.2x", col_value [RED_PIX],
col_value [GREEN_PIX], col_value [BLUE_PIX]);
break;
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
@ -408,6 +415,8 @@ color_picker_info_update (Tool *tool,
sprintf (red_buf, "%d", col_value [RED_PIX]);
sprintf (green_buf, "%d", col_value [GREEN_PIX]);
sprintf (blue_buf, "%d", col_value [BLUE_PIX]);
sprintf (hex_buf, "#%.2x%.2x%.2x", col_value [RED_PIX],
col_value [GREEN_PIX], col_value [BLUE_PIX]);
break;
case GRAY_GIMAGE: case GRAYA_GIMAGE:
@ -416,6 +425,8 @@ color_picker_info_update (Tool *tool,
sprintf (alpha_buf, "%d", col_value [ALPHA_PIX]);
else
sprintf (alpha_buf, "N/A");
sprintf (hex_buf, "#%.2x%.2x%.2x", col_value [GRAY_PIX],
col_value [GRAY_PIX], col_value [GRAY_PIX]);
break;
}
}