private void swtichColor (){
		final JDialog rbgColorDialog = new JDialog();
		rbgColorDialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
		final JSlider colorsSliders[] = new JSlider[Settings.getNumberOfColours()];
		String colorlables[] = new String[]{"R","G","B"};
		//instruction label
		JLabel instruction = new JLabel( "Drag the slider to switch colours ");
		
		//check box, to see if we are switching the background color or the circle color
		final JCheckBox backgroundColorSwitchCheckBox= new JCheckBox();
		
		//the actuall dialog
		
		rbgColorDialog.setTitle("Color Setting");
		rbgColorDialog.setSize(500, 300);
		

		
		//color slider container
		JPanel colorSliders = new JPanel();
		colorSliders.setLayout(new BoxLayout(colorSliders,BoxLayout.Y_AXIS));
		colorSliders.setSize(250, 300);
		colorSliders.add(instruction);
		for (int i=0; i <colorsSliders.length; ++i){
			JPanel tempPanel= 	new JPanel();
			tempPanel.setLayout(new BoxLayout(tempPanel,BoxLayout.X_AXIS));
			JLabel colorLabel = new JLabel( colorlables[i]);
			tempPanel.add(colorLabel);
			colorsSliders[i] = getSlider(i);
			tempPanel.add(colorsSliders[i]);
			colorSliders.add(tempPanel);
		}
		
		//inital values for the sliders
		Color previewColor = resetColorPreview(false,colorsSliders);
		
		//the label to show the color that user picked
	
		selectedColor.setBackground(new Color(previewColor.getRGB()));
		selectedColor.setOpaque(true);
		selectedColor.setSize(50, 100);
		colorSliders.add(selectedColor);
		
		//check box to apply color to the background
		JPanel checkboxPanel = new JPanel();
		checkboxPanel.setLayout(new BoxLayout(checkboxPanel,BoxLayout.X_AXIS));
		JLabel checkboxLabel = new JLabel("tick here if you want the color to be applied to the background");
		
		backgroundColorSwitchCheckBox.addActionListener(new ActionListener(){

			@Override
			public void actionPerformed(ActionEvent e) {
				resetColorPreview(backgroundColorSwitchCheckBox.isSelected(),colorsSliders);
			}
		});
		
		checkboxPanel.add(backgroundColorSwitchCheckBox);
		checkboxPanel.add(checkboxLabel);
		colorSliders.add(checkboxPanel);
		
		
		
		//ok and cancel buttons
		JPanel buttons = new JPanel();
		buttons.setLayout(new BoxLayout(buttons,BoxLayout.X_AXIS));
		JButton okButton = new JButton("Confirm");
		JButton cancelButton = new JButton("Cancel");
		
		okButton.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent arg0) {
				Color newColor = new Color(selectedColorArray[RED],selectedColorArray[GREEN],selectedColorArray[BLUE]);
				if (backgroundColorSwitchCheckBox.isSelected()){
					backgroundColor = newColor;
				} else if (selectedShape != null && selectedShape.isSelected()){
					selectedShape.setColour(newColor);
				}
				else {
					drawings.setColor(newColor);
				}
				repaint();
				rbgColorDialog.dispose();
			}
		});
		
		cancelButton.addActionListener(new ActionListener(){

			@Override
			public void actionPerformed(ActionEvent e) {
				rbgColorDialog.dispose();
			}
			
		});
		
		buttons.add(cancelButton);
		buttons.add(okButton);
		colorSliders.add(buttons);
		
		rbgColorDialog.validate();
		rbgColorDialog.add(colorSliders);
		rbgColorDialog.setVisible(true);
	}