{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

LinearGradient

public final class LinearGradient extends ShaderBrush

java.lang.Object
   ↳ androidx.compose.ui.graphics.Brush
     ↳ androidx.compose.ui.graphics.ShaderBrush
       ↳ androidx.compose.ui.graphics.LinearGradient

Brush implementation used to apply a linear gradient on a given Paint

Summary

Public methods

@NonNull Shader
boolean
equals(Object other)
@NonNull Size

Return the intrinsic size of the Brush.

int
@NonNull String

Inherited methods

From androidx.compose.ui.graphics.ShaderBrush
final void
applyTo(@NonNull Size size, @NonNull Paint p, float alpha)

Public methods

createShader

public @NonNull Shader createShader(@NonNull Size size)

equals

public boolean equals(Object other)

getIntrinsicSize

public @NonNull Size getIntrinsicSize()

Return the intrinsic size of the Brush. If the there is no intrinsic size (i.e. filling bounds with an arbitrary color) return Size.Unspecified. If there is no intrinsic size in a single dimension, return Size with Float.NaN in the desired dimension.

hashCode

public int hashCode()

toString

public @NonNull String toString()