> Documentation index: https://developer.android.com/reference/llms.txt

# PointLight

Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/lighting/Light.kt+class:androidx.compose.ui.lighting.PointLight) Added in [1.14.0-alpha01](https://developer.android.com/jetpack/androidx/releases/compose-ui.md.txt#1.14.0-alpha01) Common/All
- Cmn

  ```
  class PointLight : Light
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.compose.ui.lighting.Light](https://developer.android.com/reference/kotlin/androidx/compose/ui/lighting/Light.md.txt) ||
|   | ↳ | [androidx.compose.ui.lighting.PointLight](https://developer.android.com/reference/kotlin/androidx/compose/ui/lighting/PointLight.md.txt) |

*** ** * ** ***

A light that radiates equally in every direction from a single point in front of the surface, like a bare bulb.

`elevation` is measured from the plane the surface rests on. A surface with a thickness (see `SurfaceGeometrySpec`) rises towards the light, so the light's height above it is `elevation - thickness`. Keep `elevation` larger than the thickness so the light stays in front of the surface.

Brightness falls away with distance and reaches zero at `falloffRadius`. The distance is measured in three dimensions, so it includes the light's height above the surface: a light raised `falloffRadius` or more above the surface cannot reach it at all, and lights nothing. Keep `falloffRadius` comfortably larger than `elevation - thickness`.

```kotlin
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.lighting.LightPosition
import androidx.compose.ui.lighting.PointLight
import androidx.compose.ui.lighting.SurfaceGeometrySpec
import androidx.compose.ui.lighting.SurfaceMaterial
import androidx.compose.ui.lighting.illuminate
import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.dp

// Since our light color is white, we set a darker background so that its visible.
val backgroundColor = remember { Color.Black }
val surfaceShape = remember { RoundedCornerShape(24.dp) }
Box(
    Modifier.size(160.dp)
        .background(backgroundColor)
        .illuminate(
            lights =
                listOf(
                    PointLight(
                        color = Color.White,
                        // Above the top-left corner of the lit composable.
                        position = LightPosition.Local(DpOffset(x = 0.dp, y = 0.dp)),
                        elevation = 48.dp,
                        falloffRadius = 320.dp,
                        intensity = 1f,
                    )
                ),
            surfaceMaterial =
                SurfaceMaterial.diffuse(Color.White).specular(Color.White, shininess = 32f),
            surfaceGeometrySpec =
                SurfaceGeometrySpec.convex(
                    shape = surfaceShape,
                    thickness = 1.dp,
                    bevelWidth = 12.dp,
                ),
        )
)
```

| Throws |
|---|---|
| `IllegalArgumentException` | if `elevation` or `falloffRadius` is `Dp.Unspecified`. |

## Summary

| ### Public constructors |
|---|---|
| `PointLight( color: Color, position: LightPosition, elevation: Dp, falloffRadius: Dp, intensity: @FloatRange(from = 0.0) Float )` | Cmn |

| ### Public functions |
|---|---|---|
| `open operator Boolean` | `equals(other: Any?)` | Cmn |
| `open Int` | `hashCode()` | Cmn |
| `open String` | `toString()` | Cmn |

| ### Public properties |
|---|---|---|
| `open Color` | `color` color emitted by this light. | Cmn |
| `Dp` | `elevation` distance of the light in front of the plane the surface rests on, towards the viewer. | Cmn |
| `Dp` | `falloffRadius` distance at which the light has fully faded out. | Cmn |
| `open @FloatRange(from = 0.0) Float` | `intensity` multiplier applied to `color`. | Cmn |
| `open LightPosition` | `position` where the light sits in the plane of the surface. | Cmn |

## Public constructors

### PointLight

Cmn Added in [1.14.0-alpha01](https://developer.android.com/jetpack/androidx/releases/compose-ui.md.txt#1.14.0-alpha01)

```
PointLight(
    color: Color,
    position: LightPosition,
    elevation: Dp,
    falloffRadius: Dp,
    intensity: @FloatRange(from = 0.0) Float
)
```

| Parameters |
|---|---|
| `color: Color` | color emitted by this light. |
| `position: LightPosition` | where the light sits in the plane of the surface. |
| `elevation: Dp` | distance of the light in front of the plane the surface rests on, towards the viewer. The light's height above the surface itself is `elevation - thickness`. |
| `falloffRadius: Dp` | distance at which the light has fully faded out. A radius of zero or less disables falloff entirely, so the light reaches the whole surface at full strength. |
| `intensity: @FloatRange(from = 0.0) Float` | multiplier applied to `color`. A light with an intensity of `0` contributes nothing. |

## Public functions

### equals

Cmn

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

Cmn

```
open fun hashCode(): Int
```

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### color

Cmn

```
open val color: Color
```

color emitted by this light.

### elevation

Cmn

```
val elevation: Dp
```

distance of the light in front of the plane the surface rests on, towards the viewer. The light's height above the surface itself is `elevation - thickness`.

### falloffRadius

Cmn

```
val falloffRadius: Dp
```

distance at which the light has fully faded out. A radius of zero or less disables falloff entirely, so the light reaches the whole surface at full strength.

### intensity

Cmn

```
open val intensity: @FloatRange(from = 0.0) Float
```

multiplier applied to `color`. A light with an intensity of `0` contributes nothing.

### position

Cmn

```
open val position: LightPosition
```

where the light sits in the plane of the surface.