Code example for Paint

Methods: measureText, setColor, setTextSize

0
		 * @param canvas 
		 */ 
		private void drawSwatches(Canvas canvas) {
			float[] hsv = new float[3];
 
			mText.setTextSize(16);
 
			//Draw the original swatch 
			canvas.drawRect(mOldSwatchRect, mSwatchOld);
			Color.colorToHSV(mOriginalColor, hsv);
			//if (UberColorPickerDialog.isGray(mColor))	//Don't need this right here, but imp't to note 
			//	hsv[1] = 0; 
			if (hsv[2] > .5)
				mText.setColor(Color.BLACK);
			canvas.drawText("Revert", mOldSwatchRect.left + SWATCH_WIDTH / 2 - mText.measureText("Revert") / 2, mOldSwatchRect.top + 16, mText);
			mText.setColor(Color.WHITE);
 
			//Draw the new swatch 
			canvas.drawRect(mNewSwatchRect, mSwatchNew);
			if (mHSV[2] > .5)
				mText.setColor(Color.BLACK);
			canvas.drawText("Accept", mNewSwatchRect.left + SWATCH_WIDTH / 2 - mText.measureText("Accept") / 2, mNewSwatchRect.top + 16, mText);
			mText.setColor(Color.WHITE);
 
			mText.setTextSize(TEXT_SIZE);
		} 
 
		/** 
		 * Write the color parametes (HSV, RGB, YUV, Hex, etc.). 
		 * @param canvas