Code example for Canvas

Methods: drawArc, drawCircle, drawOval, translate

0
					} else { 
						value = index - decimals;
					} 
				} 
 
				// Calculate the angle in rad (from -PI to PI) 
				float angle = (float) (2 * Math.PI * value / (COLORS.length - 1));
				if (angle > Math.PI) {
					angle -= 2 * Math.PI;
				} 
 
				return angle;
			} 
		} 
 
		// This shouldn't happen 
		return 0; 
	} 
 
	/** 
	 * "Normalize" the supplied color. 
	 * 
	 * <p> 
	 * This will set the lowest value of R,G,B to 0, the highest to 255, and will keep the middle 
	 * value.<br> 
	 * For values close to those on the color wheel this will result in close matches. For other 
	 * values, especially shades of grey this will produce funny results. 
	 * </p> 
	 * 
	 * @param color 
	 *         The color to "normalize". 
	 * 
	 * @return An {@code int} array with the following contents: 
	 *         <ol>