aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nsterm.m19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index c4151598906..6995577920e 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2290,19 +2290,24 @@ ns_lisp_to_color (Lisp_Object color, NSColor **col)
2290 2290
2291/* Convert an index into the color table into an RGBA value. Used in 2291/* Convert an index into the color table into an RGBA value. Used in
2292 xdisp.c:extend_face_to_end_of_line when comparing faces and frame 2292 xdisp.c:extend_face_to_end_of_line when comparing faces and frame
2293 color values. */ 2293 color values. No-op on non-gui frames. */
2294 2294
2295unsigned long 2295unsigned long
2296ns_color_index_to_rgba(int idx, struct frame *f) 2296ns_color_index_to_rgba(int idx, struct frame *f)
2297{ 2297{
2298 NSColor *col; 2298 if (FRAME_DISPLAY_INFO (f))
2299 col = ns_lookup_indexed_color (idx, f); 2299 {
2300 NSColor *col;
2301 col = ns_lookup_indexed_color (idx, f);
2300 2302
2301 EmacsCGFloat r, g, b, a; 2303 EmacsCGFloat r, g, b, a;
2302 [col getRed: &r green: &g blue: &b alpha: &a]; 2304 [col getRed: &r green: &g blue: &b alpha: &a];
2303 2305
2304 return ARGB_TO_ULONG((int)(a*255), 2306 return ARGB_TO_ULONG((int)(a*255),
2305 (int)(r*255), (int)(g*255), (int)(b*255)); 2307 (int)(r*255), (int)(g*255), (int)(b*255));
2308 }
2309 else
2310 return idx;
2306} 2311}
2307 2312
2308void 2313void