~ubuntu-branches/ubuntu/maverick/gimp/maverick-updates

« back to all changes in this revision

Viewing changes to libgimp/gimppalette.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-12-09 19:44:52 UTC
  • Revision ID: james.westby@ubuntu.com-20051209194452-yggpemjlofpjqyf4
Tags: upstream-2.2.9
ImportĀ upstreamĀ versionĀ 2.2.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* LIBGIMP - The GIMP Library
 
2
 * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
 
3
 *
 
4
 * gimppalette.c
 
5
 *
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU Lesser General Public
 
8
 * License as published by the Free Software Foundation; either
 
9
 * version 2 of the License, or (at your option) any later version.
 
10
 *
 
11
 * This library is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
 * Lesser General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Lesser General Public
 
17
 * License along with this library; if not, write to the
 
18
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
19
 * Boston, MA 02111-1307, USA.
 
20
 */
 
21
 
 
22
#include "config.h"
 
23
 
 
24
#include "gimp.h"
 
25
 
 
26
/**
 
27
 * gimp_palette_get_foreground:
 
28
 * @foreground: The foreground color.
 
29
 *
 
30
 * Get the current GIMP foreground color.
 
31
 *
 
32
 * This procedure retrieves the current GIMP foreground color. The
 
33
 * foreground color is used in a variety of tools such as paint tools,
 
34
 * blending, and bucket fill.
 
35
 *
 
36
 * Returns: TRUE on success.
 
37
 */
 
38
gboolean
 
39
gimp_palette_get_foreground (GimpRGB *foreground)
 
40
{
 
41
  return gimp_context_get_foreground (foreground);
 
42
}
 
43
 
 
44
/**
 
45
 * gimp_palette_get_background:
 
46
 * @background: The background color.
 
47
 *
 
48
 * Get the current GIMP background color.
 
49
 *
 
50
 * This procedure retrieves the current GIMP background color. The
 
51
 * background color is used in a variety of tools such as blending,
 
52
 * erasing (with non-alpha images), and image filling.
 
53
 *
 
54
 * Returns: TRUE on success.
 
55
 */
 
56
gboolean
 
57
gimp_palette_get_background (GimpRGB *background)
 
58
{
 
59
  return gimp_context_get_background (background);
 
60
}
 
61
 
 
62
/**
 
63
 * gimp_palette_set_foreground:
 
64
 * @foreground: The foreground color.
 
65
 *
 
66
 * Set the current GIMP foreground color.
 
67
 *
 
68
 * This procedure sets the current GIMP foreground color. After this is
 
69
 * set, operations which use foreground such as paint tools, blending,
 
70
 * and bucket fill will use the new value.
 
71
 *
 
72
 * Returns: TRUE on success.
 
73
 */
 
74
gboolean
 
75
gimp_palette_set_foreground (const GimpRGB *foreground)
 
76
{
 
77
  return gimp_context_set_foreground (foreground);
 
78
}
 
79
 
 
80
/**
 
81
 * gimp_palette_set_background:
 
82
 * @background: The background color.
 
83
 *
 
84
 * Set the current GIMP background color.
 
85
 *
 
86
 * This procedure sets the current GIMP background color. After this is
 
87
 * set, operations which use background such as blending, filling
 
88
 * images, clearing, and erasing (in non-alpha images) will use the new
 
89
 * value.
 
90
 *
 
91
 * Returns: TRUE on success.
 
92
 */
 
93
gboolean
 
94
gimp_palette_set_background (const GimpRGB *background)
 
95
{
 
96
  return gimp_context_set_background (background);
 
97
}
 
98
 
 
99
/**
 
100
 * gimp_palette_set_default_colors:
 
101
 *
 
102
 * Set the current GIMP foreground and background colors to black and
 
103
 * white.
 
104
 *
 
105
 * This procedure sets the current GIMP foreground and background
 
106
 * colors to their initial default values, black and white.
 
107
 *
 
108
 * Returns: TRUE on success.
 
109
 */
 
110
gboolean
 
111
gimp_palette_set_default_colors (void)
 
112
{
 
113
  return gimp_context_set_default_colors ();
 
114
}
 
115
 
 
116
/**
 
117
 * gimp_palette_swap_colors:
 
118
 *
 
119
 * Swap the current GIMP foreground and background colors.
 
120
 *
 
121
 * This procedure swaps the current GIMP foreground and background
 
122
 * colors, so that the new foreground color becomes the old background
 
123
 * color and vice versa.
 
124
 *
 
125
 * Returns: TRUE on success.
 
126
 */
 
127
gboolean
 
128
gimp_palette_swap_colors (void)
 
129
{
 
130
  return gimp_context_swap_colors ();
 
131
}