Android. Change color using SeekBar + Color interpolator

        // initialize color changer seekbar and set change listener
        sbChangeColor = (SeekBar) findViewById(R.id.sbChangeColor);
        sbChangeColor.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {
            }

            @Override
            public void onProgressChanged(SeekBar seekBar, int progress,
                    boolean fromUser) {

                // change top left rectange background color according
                // to seekbar progress from red to blue
                llLeftTop.setBackgroundColor(interpolateColor(redColor,
                        blueColor, seekBar.getProgress() / 100f));

                // change middle right rectange background color according
                // to seekbar progress from blue to red
                llRightMiddle.setBackgroundColor(interpolateColor(blueColor,
                        redColor, seekBar.getProgress() / 100f));

            }
        });
.....
    // used to take colors mix according to proportion
    private int interpolateColor(final int a, final int b,
            final float proportion) {
        final float[] hsva = new float[3];
        final float[] hsvb = new float[3];
        Color.colorToHSV(a, hsva);
        Color.colorToHSV(b, hsvb);
        for (int i = 0; i < 3; i++) {
            hsvb[i] = interpolate(hsva[i], hsvb[i], proportion);
        }
        return Color.HSVToColor(hsvb);
    }

    private float interpolate(final float a, final float b,
            final float proportion) {
        return (a + ((b - a) * proportion));
    }