---
title: "cellSample"
description: "The color of the layer inside at the centre of each character cell."
group: "effects"
groupTitle: "Filters & effects"
categoryId: "effects.stylize"
categorySlug: "effects-stylize"
categoryTitle: "Stylize"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/effects/stylize.ts#L322"
---

# cellSample

The color of the layer inside at the centre of each character cell.

```ts
cellSample(slots: {grid: FragmentStage}): FragmentStage
```

Import `effects` from `shaders/std` and use `effects.stylize.cellSample`.

One sample per cell, straight alpha. Feeds `glyphFor` (to pick the character) and `glyphTint` (to color it).

## Parameters

| Name | Type | Notes |
|---|---|---|
| `slots` | `{grid: FragmentStage}` |  |

## Example

```ts
const cell = cellSample({grid})
```

## See also

- [`charGrid`](/docs/primitives/effects-stylize/chargrid) — The character grid: which cell each pixel falls in, and where it sits inside that cell.
- [`glyphFor`](/docs/primitives/effects-stylize/glyphfor) — The character drawn in each cell, picked by how bright the cell is.

## Used by

[Ascii](/docs/components/ascii)