p_color2.c 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* This file is part of the GNU plotutils package. Copyright (C) 1995,
  2. 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc.
  3. The GNU plotutils package is free software. You may redistribute it
  4. and/or modify it under the terms of the GNU General Public License as
  5. published by the Free Software foundation; either version 2, or (at your
  6. option) any later version.
  7. The GNU plotutils package is distributed in the hope that it will be
  8. useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. General Public License for more details.
  11. You should have received a copy of the GNU General Public License along
  12. with the GNU plotutils package; see the file COPYING. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor,
  14. Boston, MA 02110-1301, USA. */
  15. #include "sys-defines.h"
  16. #include "extern.h"
  17. /* idraw's 12 standard colors, taken from idraw source. These are the only
  18. pen colors that idraw understands, so we must quantize. Quantization
  19. of fill colors is more complicated; see below.
  20. The list of 12 standard colors include 6 of the 8 vertices of the RGB
  21. cube; Magenta and Cyan are missing. It also includes Orange and Indigo
  22. (on the boundary of the cube; they more or less substitute for Magenta
  23. and Cyan). Also included are four points in the interior of the cube:
  24. Light Gray, Dark Gray, Violet, and Brown. */
  25. const plColor _pl_p_idraw_stdcolors[PS_NUM_IDRAW_STD_COLORS] =
  26. {
  27. {0x0000, 0x0000, 0x0000}, /* Black */
  28. {0xa500, 0x2a00, 0x2a00}, /* Brown */
  29. {0xffff, 0x0000, 0x0000}, /* Red */
  30. {0xffff, 0xa5a5, 0x0000}, /* Orange */
  31. {0xffff, 0xffff, 0x0000}, /* Yellow */
  32. {0x0000, 0xffff, 0x0000}, /* Green */
  33. {0x0000, 0x0000, 0xffff}, /* Blue */
  34. {0xbf00, 0x0000, 0xff00}, /* Indigo */
  35. {0x4f00, 0x2f00, 0x4f00}, /* Violet */
  36. {0xffff, 0xffff, 0xffff}, /* White */
  37. {0xc350, 0xc350, 0xc350}, /* LtGray */
  38. {0x80e8, 0x80e8, 0x80e8} /* DkGray */
  39. };
  40. const char * const _pl_p_idraw_stdcolornames[PS_NUM_IDRAW_STD_COLORS] =
  41. {
  42. "Black", "Brown", "Red", "Orange", "Yellow", "Green",
  43. "Blue", "Indigo", "Violet", "White", "LtGray", "DkGray"
  44. };
  45. /* Idraw allows a fill color to be an interpolation of a pen color
  46. (``foreground color'') and a background color; both must be in the above
  47. list. The following is a list of the interpolations (``shadings'') that
  48. idraw recognizes. 0.0 means use foreground color, 1.0 means use
  49. background color. (Idraw shadings are actually a special case of idraw
  50. patterns, which include bitmap fillings as well.) */
  51. const double _pl_p_idraw_stdshadings[PS_NUM_IDRAW_STD_SHADINGS] =
  52. {
  53. 0.0, 0.25, 0.5, 0.75, 1.0
  54. };