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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines