Skip to content

Add userColor3 and userColor4 hat colors#3206

Merged
AndreasArvidsson merged 4 commits intocursorless-dev:mainfrom
trillium:add-user-colors-3-4
Mar 12, 2026
Merged

Add userColor3 and userColor4 hat colors#3206
AndreasArvidsson merged 4 commits intocursorless-dev:mainfrom
trillium:add-user-colors-3-4

Conversation

@trillium
Copy link
Contributor

@trillium trillium commented Mar 9, 2026

Add userColor3 and userColor4 hat colors

Summary

Add two additional user-configurable hat colors (userColor3 and userColor4) to Cursorless. Currently only 2 user-defined colors exist (userColor1/navy and userColor2/apricot), I use 4 colors and as a result am building the extension locally from my personal fork. Would be great if that step wasn't necessary.

Changes

  • Talon: Added userColor3 and userColor4 to color enablement defaults and spoken forms (cursorless-talon/src/marks/decorated_mark.py, cursorless-talon/src/spoken_forms.json)
  • Type definitions: Extended HatColor union type in all legacy command type files (V0V1, V2, V3)
  • Spoken form generation: Added default spoken form mappings for the new colors (cursorless-engine/src/generateSpokenForm/defaultSpokenForms/marks.ts)
  • VS Code extension: Added the new colors to all relevant package.json settings — light/dark color values, hat enablement booleans, hat penalties, and color enum list. Default colors: olive green (#6b8e23) and light gray (#e0e0e0)
  • Hat styles: Added to the HAT_COLORS const array (hatStyles.types.ts)
  • Docs: Updated the user-facing color table in README.md

Both new colors are disabled by default, matching the pattern of userColor1/userColor2.

Test plan

  • Verify VS Code loads without errors with default settings
  • Enable userColor3 and userColor4 in settings and confirm hats render with the configured colors
  • Assign custom spoken form names to the new colors (e.g., "white" → userColor3, "black" → userColor4) since the defaults are placeholder names — users must name their colors to use them
  • Confirm existing colors (including userColor1/userColor2) are unaffected
  • Run existing test suite

Add two additional user-configurable hat colors (userColor3, userColor4)
to support users who need more than 2 custom colors. Some users
configure colors like plum, teal, black, and white, exceeding the
current limit of 2 user-defined colors.
@trillium trillium marked this pull request as ready for review March 9, 2026 08:13
@trillium trillium requested a review from a team as a code owner March 9, 2026 08:13
@AndreasArvidsson
Copy link
Member

I updated the placeholder names with something that would at least not error in conformer. Otherwise unless you have a good suggestion I'm fine with this. The number of users that need these many colors are few and definitely classified as power users.

@trillium
Copy link
Contributor Author

trillium commented Mar 11, 2026

Thanks Andreas!

I use purple (aliased plum) and black/white/teal with a border color and a larger penalty so they don't render on shaped hats since the border eats the inner color and isn't very distinguishable.

I think it's black/white/teal have a penalty of 1, and shapes have a penalty of 2, with a cap of 3? Something like that

Default colors + plum > black/white/teal > shaped hats > shaped hats with colors

I find the colors stay in my brain a little easier than the shapes so I wanted more of them.

It's working great :)

Screenshots

image image image image

Thanks Andreas!

@AndreasArvidsson
Copy link
Member

AndreasArvidsson commented Mar 11, 2026

That's interesting because I don't have any user colors on and I still mix green and blue up sometimes. I believe Pokey has disabled one of those for the same reason. Running with all shapes works great for us though. I guess everyone is different :)

Do you want me to merge?

@trillium
Copy link
Contributor Author

Yes please :)

@AndreasArvidsson AndreasArvidsson merged commit 86da9f4 into cursorless-dev:main Mar 12, 2026
15 checks passed
cursorless-bot pushed a commit that referenced this pull request Mar 12, 2026
## Add userColor3 and userColor4 hat colors

### Summary

Add two additional user-configurable hat colors (`userColor3` and
`userColor4`) to Cursorless. Currently only 2 user-defined colors exist
(`userColor1`/navy and `userColor2`/apricot), I use 4 colors and as a
result am building the extension locally from my personal fork. Would be
great if that step wasn't necessary.

### Changes

- **Talon**: Added `userColor3` and `userColor4` to color enablement
defaults and spoken forms
(`cursorless-talon/src/marks/decorated_mark.py`,
`cursorless-talon/src/spoken_forms.json`)
- **Type definitions**: Extended `HatColor` union type in all legacy
command type files (V0V1, V2, V3)
- **Spoken form generation**: Added default spoken form mappings for the
new colors
(`cursorless-engine/src/generateSpokenForm/defaultSpokenForms/marks.ts`)
- **VS Code extension**: Added the new colors to all relevant
`package.json` settings — light/dark color values, hat enablement
booleans, hat penalties, and color enum list. Default colors: olive
green (`#6b8e23`) and light gray (`#e0e0e0`)
- **Hat styles**: Added to the `HAT_COLORS` const array
(`hatStyles.types.ts`)
- **Docs**: Updated the user-facing color table in `README.md`

Both new colors are **disabled by default**, matching the pattern of
`userColor1`/`userColor2`.

## Test plan

- [x] Verify VS Code loads without errors with default settings
- [x] Enable `userColor3` and `userColor4` in settings and confirm hats
render with the configured colors
- [ ] Assign custom spoken form names to the new colors (e.g., "white" →
`userColor3`, "black" → `userColor4`) since the defaults are placeholder
names — users must name their colors to use them
- [x] Confirm existing colors (including userColor1/userColor2) are
unaffected
- [x] Run existing test suite

---------

Co-authored-by: Andreas Arvidsson <andreas.arvidsson87@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants