Salome HOME
Splash screen was implemented. Changes in packages SUIT and Session are integrated.
[modules/gui.git] / src / Qtx / QtxColorScale.cxx
index 469b7a9e5a4eb52cdcecfa8ebd0070818c5e284e..528e399cd39e3ebd877a8f26984533c4b1b9e17f 100755 (executable)
@@ -1055,7 +1055,7 @@ QColor QtxColorScale::getColor( const int idx ) const
        if ( colorMode() == User )
                res = color( idx );
        else
-               res = QColor( hueFromValue( idx, 0, intervalsNumber() - 1 ), 255, 255, QColor::Hsv );
+    res = Qtx::scaleColor( idx, 0, intervalsNumber() - 1 );
        return res;
 }
 
@@ -1121,31 +1121,6 @@ QSimpleRichText* QtxColorScale::simpleRichText( const int flags ) const
        return srt;
 }
 
-//================================================================
-// Function : hueFromValue
-// Purpose  : 
-//================================================================
-
-int QtxColorScale::hueFromValue( const int value, const int min, const int max ) const
-{
-  static const int HUE[10] = {230, 210, 195, 180, 160, 80, 60, 50, 30, 0};
-
-       if ( min == max )
-    return HUE[0];
-
-  double aPosition = 9.0 * ( value - min ) / ( max - min );
-
-  if ( aPosition <= 0. )
-    return HUE[0];
-
-  if ( aPosition >= 9. )
-    return HUE[9];
-
-  int idx = (int)aPosition;
-
-  return HUE[idx] + int( ( aPosition - idx ) * ( HUE[idx + 1] - HUE[idx] ) );
-}
-
 #if QT_VER == 3
 
 /*********************************************************************