Code example for LinearGradient

0
			float x1 = endPoint.getX().getAsPixels(view);
			float y1 = endPoint.getY().getAsPixels(view);
 
			switch (gradientType) {
			case LINEAR_GRADIENT:
				return new LinearGradient(x0, y0, x1, y1, colors, offsets, TileMode.CLAMP);
			case RADIAL_GRADIENT:
				// TODO: implement radial gradient 
				return null; 
			default: 
				throw new AssertionError("No valid gradient type set.");
			} 
		} 
	} 
 
	public int[] getColors() 
	{ 
		return colors;
	} 
}