---
title: "brightestNear"
description: "The brightest color in a small ring around a point: the layer grown outward, so a spot just outside a bright area still reads as bright."
group: "effects"
groupTitle: "Filters & effects"
categoryId: "effects.blurs"
categorySlug: "effects-blurs"
categoryTitle: "Blurs, glows & screens"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/effects/blurs.ts#L197"
---

# brightestNear

The brightest color in a small ring around a point: the layer grown outward, so a spot just outside a bright area still reads as bright.

```ts
brightestNear(read: (uv: Expr) => Expr, center: Expr, opts: {radius: Expr; taps: number; angle?: number}): {
    color: Expr
    luma: Expr
}
```

Import `effects` from `shaders/std` and use `effects.blurs.brightestNear`.

`read` samples the layer at a uv and returns straight color (pass `params.sampleStraight`). `center` is the uv to look around; `radius` is the ring's radius per axis in uv, as a `vec2` (divide a pixel radius by the viewport size). `taps` points sit evenly round the ring starting at `angle` degrees, plus the centre itself. Returns the brightest of them as `color` (straight) and its brightness as `luma` (Rec.709 luminance times alpha).

## Parameters

| Name | Type | Notes |
|---|---|---|
| `read` | `(uv: Expr) => Expr` |  |
| `center` | `Expr` |  |
| `opts` | `{radius: Expr; taps: number; angle?: number}` |  |

## Example

```ts
const {color, luma} = brightestNear(params.sampleStraight, pointUV, {radius: div(p, viewport), taps: 4, angle: 45})
```

> **Tip.** Thin bright details smaller than the gap between taps can slip through; more taps
close the gaps at one sample each.

## See also

- [`gatherStack`](/docs/primitives/effects-blurs/gatherstack) — Assemble an effect from one sampling stage and an ordered list of overlay stages.

## Used by

[Sparkle](/docs/components/sparkle)