@Override
	public void stateChanged(ChangeEvent e) {
		if(!((JSlider)e.getSource()).getName().equals("size_slider")){
			Pixel p = new ColorPixel(red_slider.getValue()/100.0,
	                 green_slider.getValue()/100.0,
	                 blue_slider.getValue()/100.0);
			
			brush_color = (ColorPixel) p;
			Frame preview_frame = color_preview.getFrame();
			preview_frame.suspendNotifications();
			for (int x=0; x<preview_frame.getWidth(); x++) {
				for (int y=0; y<preview_frame.getHeight(); y++) {
					preview_frame.setPixel(x, y, brush_color);
				}
			}
			preview_frame.resumeNotifications();
		}
		else{
			brush_size = size_slider.getValue();
		}
		 
        
			
		
	}