🌈 Create new beautiful Compose Gradients with our new wesite ->
Interface

ShadowContext

Class responsible for managing shadow related dependencies.

Source set: Common
public sealed interface ShadowContext

Class responsible for managing shadow related dependencies. This includes creation and caching of various DropShadowPainter and InnerShadowPainter instances based on the provided Shadow.

Functions

createInnerShadowPainter

Source set: Common
public fun createInnerShadowPainter(shape: Shape, shadow: Shadow): InnerShadowPainter

Return an InnerShadowPainter instance for the provided shape and shadow. This may return a previously allocated InnerShadowPainter instance for the same parameters, for efficiency. For example, a design system that leverages shadows may have the same properties across multiple UI elements. In this case, the same dependencies for an InnerShadowPainter can be reused.

createDropShadowPainter

Source set: Common
public fun createDropShadowPainter(shape: Shape, shadow: Shadow): DropShadowPainter

Return a DropShadowPainter instance for the provided shape and shadow. This may return a previously allocated DropShadowPainter instance for the same parameters, for efficiency. For example, a design system that leverages shadows may have the same properties across multiple UI elements. In this case, the same dependencies for a DropShadowPainter can be reused.

clearCache

Source set: Common
public fun clearCache()

Clear all previously cached InnerShadowPainter and DropShadowPainter instances alongside all other shadow dependencies.