From 3ab2e2a466950b0c85907a4dd2b976a862a3e05b Mon Sep 17 00:00:00 2001 From: buliabyak Date: Sun, 7 Oct 2007 06:00:44 +0000 Subject: [PATCH] export average_color --- src/gradient-chemistry.cpp | 4 ++-- src/gradient-chemistry.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp index df013fdfc..486d38167 100644 --- a/src/gradient-chemistry.cpp +++ b/src/gradient-chemistry.cpp @@ -558,8 +558,8 @@ sp_get_stop_i(SPGradient *gradient, guint stop_i) return stop; } -static guint32 -average_color (guint32 c1, guint32 c2, gdouble p = 0.5) +guint32 +average_color (guint32 c1, guint32 c2, gdouble p) { guint32 r = (guint32) (SP_RGBA32_R_U (c1) * (1 - p) + SP_RGBA32_R_U (c2) * p); guint32 g = (guint32) (SP_RGBA32_G_U (c1) * (1 - p) + SP_RGBA32_G_U (c2) * p); diff --git a/src/gradient-chemistry.h b/src/gradient-chemistry.h index af7315b4c..13e15e5b8 100644 --- a/src/gradient-chemistry.h +++ b/src/gradient-chemistry.h @@ -62,6 +62,8 @@ SPStop* sp_get_stop_i(SPGradient *gradient, guint i); guint sp_number_of_stops(SPGradient *gradient); guint sp_number_of_stops_before_stop(SPGradient *gradient, SPStop *target); +guint32 average_color (guint32 c1, guint32 c2, gdouble p = 0.5); + SPStop *sp_vector_add_stop (SPGradient *vector, SPStop* prev_stop, SPStop* next_stop, gfloat offset); void sp_gradient_transform_multiply (SPGradient *gradient, NR::Matrix postmul, bool set); -- 2.30.2