Commit 626da25c authored by Michael Natterer's avatar Michael Natterer 😴

app: add accessors for the built-in FG->BG, FG->transparent etc. gradients

parent 2ed1c596
......@@ -107,6 +107,38 @@ gimp_gradients_init (Gimp *gimp)
gradient->segments->right_color_type = GIMP_GRADIENT_COLOR_FOREGROUND_TRANSPARENT;
}
GimpGradient *
gimp_gradients_get_fg_bg_rgb (Gimp *gimp)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
return g_object_get_data (G_OBJECT (gimp), FG_BG_RGB_KEY);
}
GimpGradient *
gimp_gradients_get_fg_bg_hsv_ccw (Gimp *gimp)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
return g_object_get_data (G_OBJECT (gimp), FG_BG_HSV_CCW_KEY);
}
GimpGradient *
gimp_gradients_get_fg_bg_hsv_cw (Gimp *gimp)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
return g_object_get_data (G_OBJECT (gimp), FG_BG_HSV_CW_KEY);
}
GimpGradient *
gimp_gradients_get_fg_transparent (Gimp *gimp)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
return g_object_get_data (G_OBJECT (gimp), FG_TRANSPARENT_KEY);
}
/* private functions */
......
......@@ -22,7 +22,12 @@
#define __GIMP_GRADIENTS__
void gimp_gradients_init (Gimp *gimp);
void gimp_gradients_init (Gimp *gimp);
GimpGradient * gimp_gradients_get_fg_bg_rgb (Gimp *gimp);
GimpGradient * gimp_gradients_get_fg_bg_hsv_ccw (Gimp *gimp);
GimpGradient * gimp_gradients_get_fg_bg_hsv_cw (Gimp *gimp);
GimpGradient * gimp_gradients_get_fg_transparent (Gimp *gimp);
#endif /* __GIMP_GRADIENTS__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment