color.c 930 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*!
  2. \file lib/cairodriver/color.c
  3. \brief GRASS cairo display driver - colors management
  4. (C) 2007-2008 by Lars Ahlzen and the GRASS Development Team
  5. This program is free software under the GNU General Public License
  6. (>=v2). Read the file COPYING that comes with GRASS for details.
  7. \author Lars Ahlzen <lars ahlzen.com> (original contibutor)
  8. \author Glynn Clements
  9. */
  10. #include "cairodriver.h"
  11. /*!
  12. \brief Set source color (opaque)
  13. This color will then be used for any subsequent drawing operation
  14. until a new source pattern is set.
  15. \param r red color value
  16. \param g green color value
  17. \param b blue color value
  18. */
  19. void Cairo_Color(int r, int g, int b)
  20. {
  21. G_debug(3, "Cairo_Color: %d,%d,%d", r, g, b);
  22. cairo_set_source_rgba(cairo,
  23. CAIROCOLOR(r), CAIROCOLOR(g), CAIROCOLOR(b), 1.0);
  24. G_debug(3, "Set color to: %g %g %g",
  25. CAIROCOLOR(r), CAIROCOLOR(g), CAIROCOLOR(b));
  26. }