Color.c 863 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*!
  2. \file 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 color value
  16. */
  17. void Cairo_Color(int r, int g, int b)
  18. {
  19. G_debug(3, "Cairo_Color: %d,%d,%d", r, g, b);
  20. cairo_set_source_rgba(cairo,
  21. CAIROCOLOR(r), CAIROCOLOR(g), CAIROCOLOR(b), 1.0);
  22. G_debug(3, "Set color to: %g %g %g",
  23. CAIROCOLOR(r), CAIROCOLOR(g), CAIROCOLOR(b));
  24. }