Code example for SeekBar

Methods: setProgress

0
                      green.getProgress(), blue.getProgress()));
  } 
   
  public void setColor(int color) {
    red.setProgress(Color.red(color));
    green.setProgress(Color.green(color));
    blue.setProgress(Color.blue(color));
    swatch.setBackgroundColor(color);
  } 
   
  private SeekBar.OnSeekBarChangeListener onMix=new SeekBar.OnSeekBarChangeListener() {
    public void onProgressChanged(SeekBar seekBar, int progress, 
                                  boolean fromUser) { 
      int color=getColor(); 
       
      swatch.setBackgroundColor(color); 
       
      if (listener!=null) { 
        listener.onColorChange(color); 
      }