ShadowUtils

Functions

Link copied to clipboard
fun computeTonalAmbientColor(ambientColor: Int, spotColor: Int): Int

Helper routine to compute ambient color value for one-pass tonal alpha.

Link copied to clipboard
fun computeTonalSpotColor(ambientColor: Int, spotColor: Int): Int

Helper routine to compute spot color value for one-pass tonal alpha.

Link copied to clipboard
fun drawShadow(canvas: Canvas, path: Path, zPlaneParams: Point3, lightPos: Point3, lightRadius: Float, ambientColor: Int, spotColor: Int, transparentOccluder: Boolean, geometricOnly: Boolean)

Draw an offset spot shadow and outlining ambient shadow for the given path using a disc light. The shadow may be cached, depending on the path type and canvas matrix. If the matrix is perspective or the path is volatile, it will not be cached.