2000-05-31 14:15:06 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2003-07-03 08:47:26 +08:00
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
2000-05-31 14:15:06 +08:00
|
|
|
*
|
2004-09-23 02:43:09 +08:00
|
|
|
* gimppalette.c
|
1998-01-25 18:26:47 +08:00
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
1999-11-18 05:13:50 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1998-01-25 18:26:47 +08:00
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2000-05-31 14:15:06 +08:00
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-06-01 22:59:22 +08:00
|
|
|
* Lesser General Public License for more details.
|
1998-01-25 18:26:47 +08:00
|
|
|
*
|
1999-11-18 05:13:50 +08:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
2000-05-31 14:15:06 +08:00
|
|
|
*/
|
|
|
|
|
2002-05-14 07:30:23 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2000-06-01 22:59:22 +08:00
|
|
|
#include "gimp.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_palette_get_foreground:
|
2001-01-25 09:20:05 +08:00
|
|
|
* @foreground: The foreground color.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Get the current GIMP foreground color.
|
|
|
|
*
|
|
|
|
* This procedure retrieves the current GIMP foreground color. The
|
|
|
|
* foreground color is used in a variety of tools such as paint tools,
|
|
|
|
* blending, and bucket fill.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2001-01-25 09:20:05 +08:00
|
|
|
gimp_palette_get_foreground (GimpRGB *foreground)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2004-09-23 02:43:09 +08:00
|
|
|
return gimp_context_get_foreground (foreground);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_palette_get_background:
|
2001-01-25 09:20:05 +08:00
|
|
|
* @background: The background color.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Get the current GIMP background color.
|
|
|
|
*
|
|
|
|
* This procedure retrieves the current GIMP background color. The
|
|
|
|
* background color is used in a variety of tools such as blending,
|
|
|
|
* erasing (with non-alpha images), and image filling.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2001-01-25 09:20:05 +08:00
|
|
|
gimp_palette_get_background (GimpRGB *background)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2004-09-23 02:43:09 +08:00
|
|
|
return gimp_context_get_background (background);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_palette_set_foreground:
|
2001-01-25 09:20:05 +08:00
|
|
|
* @foreground: The foreground color.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Set the current GIMP foreground color.
|
|
|
|
*
|
|
|
|
* This procedure sets the current GIMP foreground color. After this is
|
|
|
|
* set, operations which use foreground such as paint tools, blending,
|
|
|
|
* and bucket fill will use the new value.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_palette_set_foreground (const GimpRGB *foreground)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2004-09-23 02:43:09 +08:00
|
|
|
return gimp_context_set_foreground (foreground);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_palette_set_background:
|
2001-01-25 09:20:05 +08:00
|
|
|
* @background: The background color.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Set the current GIMP background color.
|
|
|
|
*
|
|
|
|
* This procedure sets the current GIMP background color. After this is
|
|
|
|
* set, operations which use background such as blending, filling
|
|
|
|
* images, clearing, and erasing (in non-alpha images) will use the new
|
|
|
|
* value.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_palette_set_background (const GimpRGB *background)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2004-09-23 02:43:09 +08:00
|
|
|
return gimp_context_set_background (background);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
1998-03-02 03:38:25 +08:00
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_palette_set_default_colors:
|
|
|
|
*
|
|
|
|
* Set the current GIMP foreground and background colors to black and
|
|
|
|
* white.
|
|
|
|
*
|
|
|
|
* This procedure sets the current GIMP foreground and background
|
|
|
|
* colors to their initial default values, black and white.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
1998-03-02 03:38:25 +08:00
|
|
|
gimp_palette_set_default_colors (void)
|
|
|
|
{
|
2004-09-23 02:43:09 +08:00
|
|
|
return gimp_context_set_default_colors ();
|
1998-03-02 03:38:25 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_palette_swap_colors:
|
|
|
|
*
|
|
|
|
* Swap the current GIMP foreground and background colors.
|
|
|
|
*
|
|
|
|
* This procedure swaps the current GIMP foreground and background
|
|
|
|
* colors, so that the new foreground color becomes the old background
|
|
|
|
* color and vice versa.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
1998-03-02 03:38:25 +08:00
|
|
|
gimp_palette_swap_colors (void)
|
|
|
|
{
|
2004-09-23 02:43:09 +08:00
|
|
|
return gimp_context_swap_colors ();
|
2000-06-01 22:59:22 +08:00
|
|
|
}
|