Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

androidx.compose.ui.graphics

Interfaces

Canvas

GraphicsLayerScope

A scope which can be used to define the effects to apply for the content, such as scaling (scaleX, scaleY), rotation (rotationX, rotationY, rotationZ), opacity (alpha), shadow (shadowElevation, shape), and clipping (clip, shape).

ImageBitmap

Graphics object that represents a 2 dimensional array of pixel information represented as ARGB values

Paint

Path

PathMeasure

Shape

Defines a generic shape.

Classes

AndroidPaint

AndroidPath

AndroidPathMeasure

Brush

CanvasHolder

Holder class that is used to issue scoped calls to a Canvas from the framework equivalent canvas without having to allocate an object on each draw call

Color

The Color class contains color information to be used while painting in Canvas.

ColorFilter

Creates a color filter that applies the blend mode given as the second argument.

LinearGradient

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

Matrix

Outline

Defines a simple shape, used for bounding graphical regions.

PixelMap

Result of a pixel read operation.

RadialGradient

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

ShaderBrush

Brush implementation that wraps and applies a the provided shader to a Paint

Shadow

A single shadow.

SolidColor

SweepGradient

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

TransformOrigin

A two-dimensional position represented as a fraction of the Layer's width and height

Vertices

A set of vertex data used by Canvas.drawVertices.

Type-aliases

ColorStop

Enums

BlendMode

Algorithms to use when painting on the canvas.

ClipOp

Defines how a new clip region should be merged with the existing clip region.

FilterQuality

ImageBitmapConfig

Possible ImageBitmap configurations.

PaintingStyle

Strategies for painting shapes and paths on a canvas.

PathFillType

Determines the winding rule that decides how the interior of a Path is calculated.

PathOperation

Strategies for combining paths.

PointMode

Used by Canvas.drawPoints.

StrokeCap

Styles to use for line endings.

StrokeJoin

Styles to use for line joins.

TileMode

VertexMode

Defines how a list of points is interpreted when drawing a set of triangles.

Top-level constants summary

const Float

Default alpha value used on Paint.

const Float

Default camera distance for all layers

Top-level functions summary

Canvas

Canvas

Create a new Canvas instance that targets its drawing commands to the provided ImageBitmap

Color
Color(red: Float, green: Float, blue: Float, alpha: Float = 1f, colorSpace: ColorSpace = ColorSpaces.Srgb)

Create a Color by passing individual red, green, blue, alpha, and colorSpace components.

Color
Color(@ColorInt color: Int)

Creates a new Color instance from an ARGB color int.

Color
Color(color: Long)

Creates a new Color instance from an ARGB color int.

Color
Color(@IntRange(0, 255) red: Int, @IntRange(0, 255) green: Int, @IntRange(0, 255) blue: Int, @IntRange(0, 255) alpha: Int = 0xFF)

Creates a new Color instance from an ARGB color components.

GraphicsLayerScope

Creates simple GraphicsLayerScope.

LinearGradient
HorizontalGradient(colors: List<Color>, startX: Float, endX: Float, tileMode: TileMode = TileMode.Clamp)

Creates a horizontal gradient with the given colors evenly dispersed within the gradient

LinearGradient
HorizontalGradient(vararg colorStops: ColorStop, startX: Float, endX: Float, tileMode: TileMode = TileMode.Clamp)

Creates a horizontal gradient with the given colors dispersed at the provided offset defined in the ColorStop

ImageBitmap
ImageAsset(width: Int, height: Int, config: ImageBitmapConfig = ImageBitmapConfig.Argb8888, hasAlpha: Boolean = true, colorSpace: ColorSpace = ColorSpaces.Srgb)

ImageBitmap
ImageBitmap(width: Int, height: Int, config: ImageBitmapConfig = ImageBitmapConfig.Argb8888, hasAlpha: Boolean = true, colorSpace: ColorSpace = ColorSpaces.Srgb)

Shader
ImageShader(image: ImageBitmap, tileModeX: TileMode = TileMode.Clamp, tileModeY: TileMode = TileMode.Clamp)

LinearGradient
LinearGradient(colors: List<Color>, startX: Float, startY: Float, endX: Float, endY: Float, tileMode: TileMode = TileMode.Clamp)

Creates a linear gradient with the provided colors along the given start and end coordinates.

LinearGradient
LinearGradient(vararg colorStops: ColorStop, startX: Float, startY: Float, endX: Float, endY: Float, tileMode: TileMode = TileMode.Clamp)

Creates a linear gradient with the provided colors along the given start and end coordinates.

Shader
LinearGradientShader(from: Offset, to: Offset, colors: List<Color>, colorStops: List<Float>? = null, tileMode: TileMode = TileMode.Clamp)

Creates a linear gradient from from to to.

actual Paint

actual Path

actual PathMeasure

RadialGradient
RadialGradient(vararg colorStops: ColorStop, centerX: Float, centerY: Float, radius: Float, tileMode: TileMode = TileMode.Clamp)

Creates a radial gradient with the given colors at the provided offset defined in the ColorStop

RadialGradient
RadialGradient(colors: List<Color>, centerX: Float, centerY: Float, radius: Float, tileMode: TileMode = TileMode.Clamp)

Creates a radial gradient with the given colors evenly dispersed within the gradient

Shader
RadialGradientShader(center: Offset, radius: Float, colors: List<Color>, colorStops: List<Float>? = null, tileMode: TileMode = TileMode.Clamp)

Creates a radial gradient centered at center that ends at radius distance from the center.

SweepGradient
SweepGradient(vararg colorStops: ColorStop, center: Offset)

Creates a sweep gradient with the given colors dispersed around the center with offsets defined in each ColorStop.

SweepGradient
SweepGradient(colors: List<Color>, center: Offset)

Creates a sweep gradient with the given colors dispersed evenly around the center.

Shader
SweepGradientShader(center: Offset, colors: List<Color>, colorStops: List<Float>? = null)

Creates a circular gradient that sweeps around a provided center point.

TransformOrigin
TransformOrigin(pivotFractionX: Float, pivotFractionY: Float)

Constructs a TransformOrigin from the given fractional values from the Layer's width and height

LinearGradient
VerticalGradient(colors: List<Color>, startY: Float, endY: Float, tileMode: TileMode = TileMode.Clamp)

Creates a vertical gradient with the given colors evenly dispersed within the gradient Ex:

LinearGradient
VerticalGradient(vararg colorStops: ColorStop, startY: Float, endY: Float, tileMode: TileMode = TileMode.Clamp)

Creates a vertical gradient with the given colors at the provided offset defined in the ColorStop Ex:

ImageBitmap

Create an ImageBitmap from an image file stored in resources for the application

Color
lerp(start: Color, stop: Color, @FloatRange(0.0, 1.0) fraction: Float)

Linear interpolate between two Colors, start and stop with fraction fraction between the two.

Shadow
lerp(start: Shadow, stop: Shadow, fraction: Float)

Linearly interpolate two Shadows.

Top-level properties summary