home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / graphics.17 / graphics / graphics-0.17 / plot2fig / color.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-12  |  1.5 KB  |  41 lines

  1. /* plot, unix plot file to graphics device translators.
  2.    Copyright (C) 1989 Free Software Foundation, Inc.
  3.  
  4.    plot is distributed in the hope that it will be useful, but WITHOUT
  5.    ANY WARRANTY.  No author or distributor accepts responsibility to
  6.    anyone for the consequences of using it or for whether it serves any
  7.    particular purpose or works at all, unless he says so in writing.
  8.    Refer to the GNU General Public License for full details.
  9.    
  10.    Everyone is granted permission to copy, modify and redistribute plot,
  11.    but only under the conditions described in the GNU General Public
  12.    License.  A copy of this license is supposed to have been given to you
  13.    along with plot so you can know your rights and responsibilities.  It
  14.    should be in a file named COPYING.  Among other things, the copyright
  15.    notice and this notice must be preserved on all copies.  */
  16.  
  17.  
  18. /* This file is the color routine, which is an extension to the plot
  19.    library. It changes the color of the following drawing operations. */
  20.  
  21. #include "sys-defines.h"
  22. #include "libplot.h"
  23. #include "extern.h"
  24.  
  25. /* FGCOLOR_RED, FGCOLOR_GREEN and FGCOLOR_BLUE indicate the foreground
  26.    color of all plot. For each the range of intensity is from 0 to 1 so
  27.    that a value of (0,0,0) represents black and a value of (1,1,1)
  28.    indicates white. */
  29.  
  30. double fgcolor_red=0., fgcolor_green=0., fgcolor_blue=0.;
  31.  
  32. int
  33. color ( red, green, blue)
  34.      int red, green, blue;
  35. {
  36.   fgcolor_red = red / 0xffff;
  37.   fgcolor_green = green / 0xffff;
  38.   fgcolor_blue = blue / 0xffff;
  39.   return 0;
  40. }
  41.