aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nsterm.m19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index 9e036aa1608..fbec816cccd 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2290,24 +2290,19 @@ 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. No-op on non-gui frames. */ 2293 color values. */
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 if (FRAME_DISPLAY_INFO (f)) 2298 NSColor *col;
2299 { 2299 col = ns_lookup_indexed_color (idx, f);
2300 NSColor *col;
2301 col = ns_lookup_indexed_color (idx, f);
2302 2300
2303 EmacsCGFloat r, g, b, a; 2301 EmacsCGFloat r, g, b, a;
2304 [col getRed: &r green: &g blue: &b alpha: &a]; 2302 [col getRed: &r green: &g blue: &b alpha: &a];
2305 2303
2306 return ARGB_TO_ULONG((int)(a*255), 2304 return ARGB_TO_ULONG((int)(a*255),
2307 (int)(r*255), (int)(g*255), (int)(b*255)); 2305 (int)(r*255), (int)(g*255), (int)(b*255));
2308 }
2309 else
2310 return idx;
2311} 2306}
2312 2307
2313void 2308void