Code

Rename LPE: mirror reflect --> mirror symmetry
[inkscape.git] / src / widgets / sp-color-gtkselector.cpp
index b583903e3e4757f9c627f6f1d5bf052bef35fe9f..10254321a54c8ba1a14f5b1d4b29ee8515fabcae 100644 (file)
@@ -128,27 +128,19 @@ ColorGtkselector::~ColorGtkselector()
 {
 }
 
-void ColorGtkselector::_colorChanged( const SPColor& color, gfloat alpha )
+void ColorGtkselector::_colorChanged()
 {
     GdkColor gcolor;
-    float rgb[3];
-    g_return_if_fail (_csel != NULL);
-    g_return_if_fail (SP_IS_COLOR_GTKSELECTOR (_csel));
-    g_return_if_fail( ( 0.0 <= alpha ) && ( alpha <= 1.0 ) );
 
-    _color = color;
-    _alpha = alpha;
-
-    sp_color_get_rgb_floatv( &color, rgb );
     gcolor.pixel = 0;
-    gcolor.red   = static_cast< guint16 > (rgb[0] * 65535);
-    gcolor.green = static_cast< guint16 > (rgb[1] * 65535);
-    gcolor.blue  = static_cast< guint16 > (rgb[2] * 65535);
+    gcolor.red   = static_cast< guint16 >(_color.v.c[0] * 65535);
+    gcolor.green = static_cast< guint16 >(_color.v.c[1] * 65535);
+    gcolor.blue  = static_cast< guint16 >(_color.v.c[2] * 65535);
 
 //     g_message( "*****  _colorChanged %04x %04x %04x", gcolor.red, gcolor.green, gcolor.blue );
     g_signal_handler_block( _gtkThing, _sigId );
-    gtk_color_selection_set_current_alpha (_gtkThing, (guint16)(65535 * alpha));
-    gtk_color_selection_set_current_color (_gtkThing, &gcolor);
+    gtk_color_selection_set_current_alpha( _gtkThing, static_cast<guint16>(65535 * _alpha) );
+    gtk_color_selection_set_current_color( _gtkThing, &gcolor );
     g_signal_handler_unblock(_gtkThing, _sigId );
 }