> For the complete documentation index, see [llms.txt](https://visionstore.gitbook.io/visionstore-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://visionstore.gitbook.io/visionstore-docs/scripts/advanced-clothing/guides/colour-filter.md).

# Colour filter

Build the colour index once on your server so players can find clothing by colour.

The colour button next to the search box opens a small palette (black, white, gray, red, orange, yellow, green, cyan, blue, purple, pink, brown, beige). It filters the current category, combines with search, favourites, owned and sort, and stays selected when changing category. Selecting an item puts on a matching colour variant right away, and **All** brings every variant back.

The colours come from an **index you build once on your own server** with an in-game admin tool. No index is shipped, because it has to match the clothing packs your server streams. Until you build it, **All** works normally and single colours only show items already indexed.

## First run

{% stepper %}
{% step %}

### Start a screenshot resource

Install and start `screencapture` (the default) or `screenshot-basic` (then set `Config.Colors.screenshotResource = 'screenshot-basic'` in `config/colors.lua`). It only has to run while a scan runs. No upload endpoint, API key or external service is used.
{% endstep %}

{% step %}

### Get the permission

Join as an admin with the `chapo.clothing.colors` ace or the `command` ace. If needed:

```properties
add_ace group.admin chapo.clothing.colors allow
```

{% endstep %}

{% step %}

### Run the scan

Close the shop, get out of any vehicle and type:

```
/clothingcolors scan
```

This processes both freemode genders, all 15 apparel categories and every texture. It uses a temporary ped in a lit studio; your own character is not replaced, teleported or saved.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
For a large wardrobe a scan can take **hours**. Use a test server or a spare game client if you can: the scan takes over that client's camera and controls. Keep the game visible, don't minimise it and don't change the resolution. While a scan runs, clothing menus can't be opened on that client.
{% endhint %}

## Stop, resume and update

| Command                              | What it does                                                              |
| ------------------------------------ | ------------------------------------------------------------------------- |
| `/clothingcolors scan`               | Scan missing records for all apparel, male and female                     |
| `/clothingcolors stop` or **ESC**    | Stop and save what's finished                                             |
| `/clothingcolors status`             | Saved records, records needing review, manual corrections                 |
| `/clothingcolors scan all review`    | Process missing and uncertain records again                               |
| `/clothingcolors scan all all`       | Reprocess every automatic record (manual corrections are kept)            |
| `/clothingcolors scan male all tops` | Reprocess one gender / category, for example after replacing its textures |
| `/clothingcolors edit`               | Correct the colours of the item you're wearing                            |

Scan arguments are `gender mode category`. Gender: `all`, `male` or `female`. Mode: `missing`, `review` or `all`. Category: `tops`, `bottoms`, `footwear`, `undershirts`, `torso`, `decals`, `armor`, `bags`, `neckwear`, `watches`, `bracelets`, `hats`, `glasses`, `earrings`, `masks` (leave it out for everything).

Running the default scan again resumes where it stopped. After adding clothing, just run it again. After **replacing** the artwork of existing items, run an `all` rescan for that category.

## Correcting an item

1. Wear the exact colour variant you want to fix and close the shop.
2. Run `/clothingcolors edit`.
3. Pick its category, choose one or more colours and save. No colour at all marks a bare / invisible variant.
4. Reopen the shop to see the change.

Manual corrections survive automatic rescans.

## Where the data lives

The index is saved in `data/colors/` inside the resource. **Keep this folder when you update the resource.** Keys use the clothing collection rather than the global drawable number, so the index survives adding, removing or reordering clothing packs. Custom peds are not scanned.

{% hint style="info" %}
The classification is a best guess. Tiny accessories, dark or see-through materials, skin-coloured clothing and decals may need a manual correction. Check `/clothingcolors status` after the first scan, then use `/clothingcolors scan all review` and `/clothingcolors edit`. If your server replaces the base undergarments, update `baseline` in `config/colors.lua` before scanning. Raise `settleMs` if textures stream in slowly.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://visionstore.gitbook.io/visionstore-docs/scripts/advanced-clothing/guides/colour-filter.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
