private void colourProgressBarRedToGreen(JProgressBar pb)
    {
        int pbv = pb.getValue();
        int r=255,g=0,b=0;
        
        if(pbv>0 && pbv<=20)
        {
            r=255; g=0; b=0;
        }
        else if(pbv>20 && pbv<=60)
        {
            r=255;g = (int) ((pbv-20)*6.375);
        }
        else if(pbv>60 && pbv<=90)
        {
            r= (int) (255-((pbv-60)*8.5));g=255;b=0;
        }
        else if(pbv>90 && pbv<=100)
        {
            r=0;g=255;b=0;
        }
        pb.setForeground(new Color(r, g, b));
    }