ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvttoolkit.C
(Generate patch)

Comparing rxvt-unicode/src/rxvttoolkit.C (file contents):
Revision 1.13 by root, Sun Feb 13 11:07:57 2005 UTC vs.
Revision 1.36 by root, Mon Jan 30 17:43:20 2006 UTC

25#include <rxvttoolkit.h> 25#include <rxvttoolkit.h>
26 26
27#include <unistd.h> 27#include <unistd.h>
28#include <fcntl.h> 28#include <fcntl.h>
29 29
30#include <sys/utsname.h>
31
30#ifndef NO_SLOW_LINK_SUPPORT 32#ifndef NO_SLOW_LINK_SUPPORT
31# include <sys/socket.h> 33# include <sys/socket.h>
32# include <sys/un.h> 34# include <sys/un.h>
33#endif 35#endif
34 36
37#if XFT
38# include <X11/extensions/Xrender.h>
39#endif
40
41const char *const xa_names[] =
42{
43 "TEXT",
44 "COMPOUND_TEXT",
45 "UTF8_STRING",
46 "MULTIPLE",
47 "TARGETS",
48 "TIMESTAMP",
49 "VT_SELECTION",
50 "INCR",
51 "WM_PROTOCOLS",
52 "WM_DELETE_WINDOW",
53 "CLIPBOARD",
54 "AVERAGE_WIDTH",
55 "WEIGHT_NAME",
56 "SLANT",
57 "CHARSET_REGISTRY",
58 "CHARSET_ENCODING",
59#if ENABLE_FRILLS
60 "_MOTIF_WM_HINTS",
61#endif
62#if ENABLE_EWMH
63 "_NET_WM_PID",
64 "_NET_WM_NAME",
65 "_NET_WM_ICON_NAME",
66 "_NET_WM_PING",
67#endif
68#if USE_XIM
69 "WM_LOCALE_NAME",
70 "XIM_SERVERS",
71#endif
72#ifdef TRANSPARENT
73 "_XROOTPMAP_ID",
74 "ESETROOT_PMAP_ID",
75#endif
76#if ENABLE_XEMBED
77 "_XEMBED",
78 "_XEMBED_INFO",
79#endif
80#if !ENABLE_MINIMAL
81 "SCREEN_RESOURCES",
82 "XDCCC_LINEAR_RGB_CORRECTION",
83 "XDCCC_LINEAR_RGB_MATRICES",
84 "WM_COLORMAP_WINDOWS",
85 "WM_STATE",
86#endif
87};
88
89/////////////////////////////////////////////////////////////////////////////
90
35refcounted::refcounted (const char *id) 91refcounted::refcounted (const char *id)
36{ 92{
37 this->id = strdup (id); 93 this->id = strdup (id);
38} 94}
39 95
47{ 103{
48 for (T **i = this->begin (); i < this->end (); ++i) 104 for (T **i = this->begin (); i < this->end (); ++i)
49 { 105 {
50 if (!strcmp (id, (*i)->id)) 106 if (!strcmp (id, (*i)->id))
51 { 107 {
52 (*i)->referenced++; 108 ++(*i)->referenced;
109 (*i)->ref_next ();
53 return *i; 110 return *i;
54 } 111 }
55 } 112 }
56 113
57 T *obj = new T (id); 114 T *obj = new T (id);
58 115
59 obj->referenced = 1;
60
61 if (obj && obj->init ()) 116 if (obj && obj->ref_init ())
62 { 117 {
118 obj->referenced = 1;
63 this->push_back (obj); 119 this->push_back (obj);
64 return obj; 120 return obj;
65 } 121 }
66 else 122 else
67 { 123 {
91} 147}
92 148
93///////////////////////////////////////////////////////////////////////////// 149/////////////////////////////////////////////////////////////////////////////
94 150
95#ifdef USE_XIM 151#ifdef USE_XIM
152
96static void 153static void
97#if XIMCB_PROTO_BROKEN 154#if XIMCB_PROTO_BROKEN
98im_destroy_cb (XIC unused1, XPointer client_data, XPointer unused3) 155im_destroy_cb (XIC unused1, XPointer client_data, XPointer unused3)
99#else 156#else
100im_destroy_cb (XIM unused1, XPointer client_data, XPointer unused3) 157im_destroy_cb (XIM unused1, XPointer client_data, XPointer unused3)
107 164
108 display->xims.erase (find (display->xims.begin (), display->xims.end (), xim)); 165 display->xims.erase (find (display->xims.begin (), display->xims.end (), xim));
109 display->im_change_cb (); 166 display->im_change_cb ();
110} 167}
111 168
169bool
112bool rxvt_xim::init () 170rxvt_xim::ref_init ()
113{ 171{
114 display = GET_R->display; //HACK: TODO 172 display = GET_R->display; //HACK: TODO
115 173
116 xim = XOpenIM (display->display, NULL, NULL, NULL); 174 xim = XOpenIM (display->display, NULL, NULL, NULL);
117 175
130rxvt_xim::~rxvt_xim () 188rxvt_xim::~rxvt_xim ()
131{ 189{
132 if (xim) 190 if (xim)
133 XCloseIM (xim); 191 XCloseIM (xim);
134} 192}
193
135#endif 194#endif
195
196/////////////////////////////////////////////////////////////////////////////
197
198void
199rxvt_screen::set (rxvt_display *disp)
200{
201 display = disp;
202 xdisp = disp->display;
203
204 Screen *screen = ScreenOfDisplay (xdisp, disp->screen);
205
206 depth = DefaultDepthOfScreen (screen);
207 visual = DefaultVisualOfScreen (screen);
208 cmap = DefaultColormapOfScreen (screen);
209}
210
211void
212rxvt_screen::set (rxvt_display *disp, int bitdepth)
213{
214 set (disp);
215
216#if XFT
217 XVisualInfo vinfo;
218
219 if (XMatchVisualInfo (xdisp, display->screen, bitdepth, TrueColor, &vinfo))
220 {
221 depth = bitdepth;
222 visual = vinfo.visual;
223 cmap = XCreateColormap (xdisp, disp->root, visual, AllocNone);
224 }
225#endif
226}
227
228void
229rxvt_screen::clear ()
230{
231 if (cmap != DefaultColormapOfScreen (ScreenOfDisplay (xdisp, display->screen)))
232 XFreeColormap (xdisp, cmap);
233}
136 234
137///////////////////////////////////////////////////////////////////////////// 235/////////////////////////////////////////////////////////////////////////////
138 236
139rxvt_display::rxvt_display (const char *id) 237rxvt_display::rxvt_display (const char *id)
140: refcounted (id) 238: refcounted (id)
141, x_ev (this, &rxvt_display::x_cb) 239, x_ev (this, &rxvt_display::x_cb)
142, selection_owner (0) 240, selection_owner (0)
143{ 241{
144} 242}
145 243
244XrmDatabase
245rxvt_display::get_resources ()
246{
247 char *homedir = (char *)getenv ("HOME");
248 char fname[1024];
249
250 /*
251 * get resources using the X library function
252 */
253 char *displayResource, *xe;
254 XrmDatabase database, rdb1;
255
256 database = NULL;
257
258 // for ordering, see for example http://www.faqs.org/faqs/Xt-FAQ/ Subject: 20
259
260 // 6. System wide per application default file.
261
262 /* Add in $XAPPLRESDIR/Rxvt only; not bothering with XUSERFILESEARCHPATH */
263 if ((xe = (char *)getenv ("XAPPLRESDIR")))
264 {
265 snprintf (fname, sizeof (fname), "%s/%s", xe, RESCLASS);
266
267 if ((rdb1 = XrmGetFileDatabase (fname)))
268 XrmMergeDatabases (rdb1, &database);
269 }
270
271 // 5. User's per application default file.
272 // none
273
274 // 4. User's defaults file.
275 /* Get any Xserver defaults */
276 displayResource = XResourceManagerString (display);
277
278 if (displayResource != NULL)
279 {
280 if ((rdb1 = XrmGetStringDatabase (displayResource)))
281 XrmMergeDatabases (rdb1, &database);
282 }
283 else if (homedir)
284 {
285 snprintf (fname, sizeof (fname), "%s/.Xdefaults", homedir);
286
287 if ((rdb1 = XrmGetFileDatabase (fname)))
288 XrmMergeDatabases (rdb1, &database);
289 }
290
291 /* Get screen specific resources */
292 displayResource = XScreenResourceString (ScreenOfDisplay (display, screen));
293
294 if (displayResource != NULL)
295 {
296 if ((rdb1 = XrmGetStringDatabase (displayResource)))
297 /* Merge with screen-independent resources */
298 XrmMergeDatabases (rdb1, &database);
299
300 XFree (displayResource);
301 }
302
303 // 3. User's per host defaults file
304 /* Add in XENVIRONMENT file */
305 if ((xe = (char *)getenv ("XENVIRONMENT"))
306 && (rdb1 = XrmGetFileDatabase (xe)))
307 XrmMergeDatabases (rdb1, &database);
308 else if (homedir)
309 {
310 struct utsname un;
311
312 if (!uname (&un))
313 {
314 snprintf (fname, sizeof (fname), "%s/.Xdefaults-%s", homedir, un.nodename);
315
316 if ((rdb1 = XrmGetFileDatabase (fname)))
317 XrmMergeDatabases (rdb1, &database);
318 }
319 }
320
321 return database;
322}
323
146bool rxvt_display::init () 324bool rxvt_display::ref_init ()
147{ 325{
326#ifdef LOCAL_X_IS_UNIX
327 if (id[0] == ':')
328 {
329 val = rxvt_malloc (5 + strlen (id) + 1);
330 strcpy (val, "unix/");
331 strcat (val, id);
332 display = XOpenDisplay (val);
333 free (val);
334 }
335 else
336#endif
337 display = 0;
338
339 if (!display)
148 display = XOpenDisplay (id); 340 display = XOpenDisplay (id);
149 341
150 if (!display) 342 if (!display)
151 return false; 343 return false;
152 344
153 screen = DefaultScreen (display); 345 screen = DefaultScreen (display);
154 root = DefaultRootWindow (display); 346 root = DefaultRootWindow (display);
155 visual = DefaultVisual (display, screen);
156 cmap = DefaultColormap (display, screen);
157 depth = DefaultDepth (display, screen);
158 347
159 int fd = XConnectionNumber (display); 348 assert (sizeof (xa_names) / sizeof (char *) == NUM_XA);
349 XInternAtoms (display, (char **)xa_names, NUM_XA, False, xa);
160 350
161#ifndef NO_SLOW_LINK_SUPPORT 351 XrmSetDatabase (display, get_resources ());
162 // try to detetc wether we have a local connection.
163 // assume unix domains socket == local, everything else not
164 // TODO: might want to check for inet/127.0.0.1
165 is_local = 0;
166 sockaddr_un sa;
167 socklen_t sl = sizeof (sa);
168
169 if (!getsockname (fd, (sockaddr *)&sa, &sl))
170 is_local = sa.sun_family == AF_LOCAL;
171#endif
172 352
173#ifdef POINTER_BLANK 353#ifdef POINTER_BLANK
174 XColor blackcolour; 354 XColor blackcolour;
175 blackcolour.red = 0; 355 blackcolour.red = 0;
176 blackcolour.green = 0; 356 blackcolour.green = 0;
179 blank_cursor = XCreateGlyphCursor (display, f, f, ' ', ' ', 359 blank_cursor = XCreateGlyphCursor (display, f, f, ' ', ' ',
180 &blackcolour, &blackcolour); 360 &blackcolour, &blackcolour);
181 XUnloadFont (display, f); 361 XUnloadFont (display, f);
182#endif 362#endif
183 363
184#ifdef PREFER_24BIT 364 int fd = XConnectionNumber (display);
185 /*
186 * If depth is not 24, look for a 24bit visual.
187 */
188 if (depth != 24)
189 {
190 XVisualInfo vinfo;
191 365
192 if (XMatchVisualInfo (display, screen, 24, TrueColor, &vinfo)) 366#ifndef NO_SLOW_LINK_SUPPORT
193 { 367 // try to detect wether we have a local connection.
194 depth = 24; 368 // assume unix domains socket == local, everything else not
195 visual = vinfo.visual; 369 // TODO: might want to check for inet/127.0.0.1
196 cmap = XCreateColormap (display, 370 is_local = 0;
197 RootWindow (display, screen), 371 sockaddr_un sa;
198 visual, AllocNone); 372 socklen_t sl = sizeof (sa);
199 } 373
200 } 374 if (!getsockname (fd, (sockaddr *)&sa, &sl))
375 is_local = sa.sun_family == AF_LOCAL;
201#endif 376#endif
202 377
203 x_ev.start (fd, EVENT_READ); 378 x_ev.start (fd, EVENT_READ);
204 fcntl (fd, F_SETFD, FD_CLOEXEC); 379 fcntl (fd, F_SETFD, FD_CLOEXEC);
205 380
206 XSelectInput (display, root, PropertyChangeMask); 381 XSelectInput (display, root, PropertyChangeMask);
207#ifdef USE_XIM
208 xa_xim_servers = XInternAtom (display, "XIM_SERVERS", 0);
209#endif
210 382
211 flush (); 383 flush ();
212 384
213 return true; 385 return true;
214} 386}
215 387
388void
389rxvt_display::ref_next ()
390{
391 // TODO: somehow check wether the database files/resources changed
392 // before re-loading/parsing
393 XrmDestroyDatabase (XrmGetDatabase (display));
394 XrmSetDatabase (display, get_resources ());
395}
396
216rxvt_display::~rxvt_display () 397rxvt_display::~rxvt_display ()
217{ 398{
399 if (!display)
400 return;
401
402#ifdef POINTER_BLANK
403 XFreeCursor (display, blank_cursor);
404#endif
218 x_ev.stop (); 405 x_ev.stop ();
219#ifdef USE_XIM 406#ifdef USE_XIM
220 xims.clear (); 407 xims.clear ();
221#endif 408#endif
222
223 if (display)
224 XCloseDisplay (display); 409 XCloseDisplay (display);
225} 410}
226 411
227#ifdef USE_XIM 412#ifdef USE_XIM
228void rxvt_display::im_change_cb () 413void rxvt_display::im_change_cb ()
229{ 414{
237 // registers, as xlib crashes due to a race otherwise. 422 // registers, as xlib crashes due to a race otherwise.
238 Atom actual_type, *atoms; 423 Atom actual_type, *atoms;
239 int actual_format; 424 int actual_format;
240 unsigned long nitems, bytes_after; 425 unsigned long nitems, bytes_after;
241 426
242 if (XGetWindowProperty (display, root, xa_xim_servers, 0L, 1000000L, 427 if (XGetWindowProperty (display, root, xa[XA_XIM_SERVERS], 0L, 1000000L,
243 False, XA_ATOM, &actual_type, &actual_format, 428 False, XA_ATOM, &actual_type, &actual_format,
244 &nitems, &bytes_after, (unsigned char **)&atoms) 429 &nitems, &bytes_after, (unsigned char **)&atoms)
245 != Success ) 430 != Success )
246 return; 431 return;
247 432
265 XNextEvent (display, &xev); 450 XNextEvent (display, &xev);
266 451
267#ifdef USE_XIM 452#ifdef USE_XIM
268 if (!XFilterEvent (&xev, None)) 453 if (!XFilterEvent (&xev, None))
269 { 454 {
270
271 if (xev.type == PropertyNotify 455 if (xev.type == PropertyNotify
272 && xev.xany.window == root 456 && xev.xany.window == root
273 && xev.xproperty.atom == xa_xim_servers) 457 && xev.xproperty.atom == xa[XA_XIM_SERVERS])
274 im_change_check (); 458 im_change_check ();
275#endif 459#endif
276 for (int i = xw.size (); i--; ) 460 for (int i = xw.size (); i--; )
277 { 461 {
278 if (!xw[i]) 462 if (!xw[i])
368refcache<rxvt_display> displays; 552refcache<rxvt_display> displays;
369 553
370///////////////////////////////////////////////////////////////////////////// 554/////////////////////////////////////////////////////////////////////////////
371 555
372bool 556bool
373rxvt_color::set (rxvt_display *display, Pixel p) 557rxvt_color::set (rxvt_screen *screen, const char *name)
374{ 558{
375#if XFT 559#if XFT
376 XColor xc; 560 int l = strlen (name);
561 rxvt_rgba r;
562 char eos;
563 int mult;
377 564
378 xc.pixel = p; 565 // shortcutting this saves countless server RTTs for the built-in colours
379 if (!XQueryColor (display->display, display->cmap, &xc)) 566 if (l == 3+3*3 && 3 == sscanf (name, "rgb:%hx/%hx/%hx/%hx%c", &r.r, &r.g, &r.b, &r.a, &eos))
380 return false; 567 {
568 r.a = rxvt_rgba::MAX_CC;
569 mult = rxvt_rgba::MAX_CC / 0x00ff;
570 }
381 571
382 XRenderColor d; 572 // parse a number of non-standard ARGB colour specifications
573 else if ( l == 1+4*1 && 4 == sscanf (name, "#%1hx%1hx%1hx%1hx%c", &r.a, &r.r, &r.g, &r.b, &eos))
574 mult = rxvt_rgba::MAX_CC / 0x000f;
575 else if (l == 1+4*2 && 4 == sscanf (name, "#%2hx%2hx%2hx%2hx%c", &r.a, &r.r, &r.g, &r.b, &eos))
576 mult = rxvt_rgba::MAX_CC / 0x00ff;
577 else if (l == 1+4*4 && 4 == sscanf (name, "#%4hx%4hx%4hx%4hx%c", &r.a, &r.r, &r.g, &r.b, &eos))
578 mult = rxvt_rgba::MAX_CC / 0xffff;
579 else if (l == 4+5*4 && 4 == sscanf (name, "rgba:%hx/%hx/%hx/%hx%c", &r.r, &r.g, &r.b, &r.a, &eos))
580 mult = rxvt_rgba::MAX_CC / 0xffff;
383 581
384 d.red = xc.red; 582 // slow case: server round trip
385 d.green = xc.green; 583 else
386 d.blue = xc.blue; 584 return XftColorAllocName (screen->xdisp, screen->visual, screen->cmap, name, &c);
387 d.alpha = 0xffff;
388 585
389 return 586 r.r *= mult; r.g *= mult; r.b *= mult; r.a *= mult;
390 XftColorAllocValue (display->display,
391 display->visual,
392 display->cmap,
393 &d, &c);
394#else
395 this->p = p;
396#endif
397 587
398 return true; 588 return set (screen, r);
399}
400
401bool
402rxvt_color::set (rxvt_display *display, const char *name)
403{
404#if XFT
405 return XftColorAllocName (display->display, display->visual, display->cmap,
406 name, &c);
407#else 589#else
408 XColor xc; 590 XColor xc;
409 591
410 if (XParseColor (display->display, display->cmap, name, &xc)) 592 if (XParseColor (screen->xdisp, screen->cmap, name, &xc))
411 return set (display, xc.red, xc.green, xc.blue); 593 return set (screen, rxvt_rgba (xc.red, xc.green, xc.blue));
412 594
413 return false; 595 return false;
414#endif 596#endif
415} 597}
416 598
417bool 599bool
418rxvt_color::set (rxvt_display *display, unsigned short cr, unsigned short cg, unsigned short cb) 600rxvt_color::set (rxvt_screen *screen, rxvt_rgba rgba)
419{ 601{
420 XColor xc; 602#if XFT
603 XRenderPictFormat *format;
421 604
422 xc.red = cr; 605 // FUCKING Xft gets it wrong, of course, so work around it
423 xc.green = cg; 606 // transparency users should eat shit and die, and then
424 xc.blue = cb; 607 // XRenderQueryPictIndexValues themselves plenty.
425 xc.flags = DoRed | DoGreen | DoBlue; 608 if (screen->visual->c_class == TrueColor
609 && (format = XRenderFindVisualFormat (screen->xdisp, screen->visual)))
610 {
611 // the fun lies in doing everything manually...
612 c.color.red = rgba.r;
613 c.color.green = rgba.g;
614 c.color.blue = rgba.b;
615 c.color.alpha = rgba.a;
426 616
427 if (XAllocColor (display->display, display->cmap, &xc)) 617 c.pixel = ((rgba.r * format->direct.redMask / rxvt_rgba::MAX_CC) << format->direct.red )
428 return set (display, xc.pixel); 618 | ((rgba.g * format->direct.greenMask / rxvt_rgba::MAX_CC) << format->direct.green)
619 | ((rgba.b * format->direct.blueMask / rxvt_rgba::MAX_CC) << format->direct.blue )
620 | ((rgba.a * format->direct.alphaMask / rxvt_rgba::MAX_CC) << format->direct.alpha);
621
622 return true;
623 }
624 else
625 {
626 XRenderColor d;
627
628 d.red = rgba.r;
629 d.green = rgba.g;
630 d.blue = rgba.b;
631 d.alpha = rgba.a;
632
633 return XftColorAllocValue (screen->xdisp, screen->visual, screen->cmap, &d, &c);
634 }
429 635
430 return false; 636 return false;
637#else
638 if (screen->visual->c_class == TrueColor)
639 {
640 p = ((rgba.r * ((1 << screen->visual->bits_per_rgb) - 1)
641 / rxvt_rgba::MAX_CC) << ctz (screen->visual->red_mask ))
642 | ((rgba.g * ((1 << screen->visual->bits_per_rgb) - 1)
643 / rxvt_rgba::MAX_CC) << ctz (screen->visual->green_mask))
644 | ((rgba.b * ((1 << screen->visual->bits_per_rgb) - 1)
645 / rxvt_rgba::MAX_CC) << ctz (screen->visual->blue_mask ));
646
647 return true;
648 }
649 else
650 {
651 XColor xc;
652
653 xc.red = rgba.r;
654 xc.green = rgba.g;
655 xc.blue = rgba.b;
656 xc.flags = DoRed | DoGreen | DoBlue;
657
658 if (XAllocColor (screen->xdisp, screen->cmap, &xc))
659 {
660 p = xc.pixel;
661 return true;
662 }
663 }
664
665 return false;
666#endif
431} 667}
432 668
433void 669void
434rxvt_color::get (rxvt_display *display, unsigned short &cr, unsigned short &cg, unsigned short &cb) 670rxvt_color::get (rxvt_screen *screen, rxvt_rgba &rgba)
435{ 671{
436#if XFT 672#if XFT
437 cr = c.color.red; 673 rgba.r = c.color.red;
438 cg = c.color.green; 674 rgba.g = c.color.green;
439 cb = c.color.blue; 675 rgba.b = c.color.blue;
676 rgba.a = c.color.alpha;
440#else 677#else
441 XColor c; 678 XColor c;
442 679
443 c.pixel = p; 680 c.pixel = p;
444 XQueryColor (display->display, display->cmap, &c); 681 XQueryColor (screen->xdisp, screen->cmap, &c);
445 682
446 cr = c.red; 683 rgba.r = c.red;
447 cg = c.green; 684 rgba.g = c.green;
448 cb = c.blue; 685 rgba.b = c.blue;
686 rgba.a = rxvt_rgba::MAX_CC;
449#endif 687#endif
450} 688}
451 689
452void 690void
453rxvt_color::free (rxvt_display *display) 691rxvt_color::free (rxvt_screen *screen)
454{ 692{
455#if XFT 693#if XFT
456 XftColorFree (display->display, display->visual, display->cmap, &c); 694 XftColorFree (screen->xdisp, screen->visual, screen->cmap, &c);
457#else 695#else
458 XFreeColors (display->display, display->cmap, &p, 1, AllPlanes); 696 XFreeColors (screen->xdisp, screen->cmap, &p, 1, AllPlanes);
459#endif 697#endif
460} 698}
461 699
462rxvt_color 700rxvt_color
463rxvt_color::fade (rxvt_display *display, int percent) 701rxvt_color::fade (rxvt_screen *screen, int percent)
464{ 702{
465 unsigned short cr, cg, cb;
466 rxvt_color faded; 703 rxvt_color faded;
467 704
468 get (display, cr, cg, cb); 705 rxvt_rgba c;
469 faded.set (display, 706 get (screen, c);
470 cr * percent / 100, 707
471 cg * percent / 100, 708 c.r = lerp (0, c.r, percent);
472 cb * percent / 100); 709 c.g = lerp (0, c.g, percent);
710 c.b = lerp (0, c.b, percent);
711
712 faded.set (screen, c);
473 713
474 return faded; 714 return faded;
475} 715}
476 716
717rxvt_color
718rxvt_color::fade (rxvt_screen *screen, int percent, rxvt_color &fadeto)
719{
720 rxvt_rgba c, fc;
721 rxvt_color faded;
722
723 get (screen, c);
724 fadeto.get (screen, fc);
725
726 faded.set (
727 screen,
728 rxvt_rgba (
729 lerp (fc.r, c.r, percent),
730 lerp (fc.g, c.g, percent),
731 lerp (fc.b, c.b, percent),
732 lerp (fc.a, c.a, percent)
733 )
734 );
735
736 return faded;
737}
738

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines