mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.0.0755: terminal window does not have colors in the GUI
Problem: Terminal window does not have colors in the GUI. Solution: Lookup the GUI color.
This commit is contained in:
@@ -5606,16 +5606,34 @@ gui_mch_get_color(char_u *name)
|
||||
return name != NULL ? gui_get_color_cmn(name) : INVALCOLOR;
|
||||
#else
|
||||
guicolor_T color;
|
||||
GdkColor gcolor;
|
||||
int ret;
|
||||
|
||||
color = (name != NULL) ? gui_get_color_cmn(name) : INVALCOLOR;
|
||||
if (color == INVALCOLOR)
|
||||
return INVALCOLOR;
|
||||
|
||||
gcolor.red = (guint16)(((color & 0xff0000) >> 16) / 255.0 * 65535 + 0.5);
|
||||
gcolor.green = (guint16)(((color & 0xff00) >> 8) / 255.0 * 65535 + 0.5);
|
||||
gcolor.blue = (guint16)((color & 0xff) / 255.0 * 65535 + 0.5);
|
||||
return gui_mch_get_rgb_color(
|
||||
(color & 0xff0000) >> 16,
|
||||
(color & 0xff00) >> 8,
|
||||
color & 0xff);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the Pixel value (color) for the given RGB values.
|
||||
* Return INVALCOLOR for error.
|
||||
*/
|
||||
guicolor_T
|
||||
gui_mch_get_rgb_color(int r, int g, int b)
|
||||
{
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
return gui_get_rgb_color_cmn(r, g, b);
|
||||
#else
|
||||
GdkColor gcolor;
|
||||
int ret;
|
||||
|
||||
gcolor.red = (guint16)(r / 255.0 * 65535 + 0.5);
|
||||
gcolor.green = (guint16)(g / 255.0 * 65535 + 0.5);
|
||||
gcolor.blue = (guint16)(b / 255.0 * 65535 + 0.5);
|
||||
|
||||
ret = gdk_colormap_alloc_color(gtk_widget_get_colormap(gui.drawarea),
|
||||
&gcolor, FALSE, TRUE);
|
||||
|
Reference in New Issue
Block a user