Class

Light

Represents a source of light.

Source set: Common
public abstract class Light internal constructor()

Represents a source of light.

Choose DirectionalLight for light arriving from infinitely far away, PointLight for a bulb at a fixed spot, and SpotLight for a bulb that only lights a cone.

Properties

color

Source set: Common
public abstract val color: Color

Color emitted by this light.

The color's alpha channel scales the emitted light alongside intensity, so a fully transparent color (alpha of 0, such as Color.Transparent) emits no light.

intensity

Source set: Common
public abstract val intensity: Float

Multiplier applied to the strength of this light.

This scales the light's contribution alongside color's alpha channel (color.alpha * intensity). A light with an intensity of 0 contributes nothing, 1 applies color at its base strength, values between 0 and 1 make the light more faint, and values greater than 1 overdrive the light, brightening its reflection towards white.

position

Source set: Common
public open val position: LightPosition

Where the light sits. Position-less lights such as DirectionalLight report an unspecified local position.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: