Skip to content

Conversation

@bborn
Copy link
Owner

@bborn bborn commented Feb 1, 2026

Summary

  • Added comprehensive documentation explaining how project colors are selected
  • Colors are assigned from a palette of 8 distinct colors using modulo arithmetic (index % 8)
  • This approach works for any number of projects - colors simply cycle after every 8 projects
  • Added tests to verify the color selection works correctly for any number of projects

How Project Colors Work

Projects are assigned colors from a predefined palette of 8 colors:

Index Color Hex
0, 8, 16, ... Purple #C678DD
1, 9, 17, ... Blue #61AFEF
2, 10, 18, ... Cyan #56B6C2
3, 11, 19, ... Green #98C379
4, 12, 20, ... Yellow #E5C07B
5, 13, 21, ... Red/Pink #E06C75
6, 14, 22, ... Orange #D19A66
7, 15, 23, ... Gray #ABB2BF

The selection uses modulo arithmetic: color = DefaultProjectColors[projectIndex % 8]

This ensures the system works for any number of projects - colors simply cycle after every 8 projects.

Test plan

  • Added tests for GetDefaultProjectColor with indices 0-7
  • Added tests for color wrapping at indices 8+
  • Added tests for large numbers (100, 1000) using modulo correctly
  • Added tests for negative index handling
  • Added tests verifying all colors are valid hex format
  • Added tests verifying all colors are distinct (no duplicates)
  • All existing tests pass: go test ./internal/ui/...

🤖 Generated with Claude Code

Project colors are selected from a palette of 8 distinct colors using
modulo arithmetic (index % 8). This ensures the system works for any
number of projects - colors simply cycle after every 8 projects.

Added comprehensive tests to verify:
- Colors are assigned correctly for indices 0-7
- Colors wrap correctly for indices 8+
- Large numbers (100+) work via modulo
- Negative indices are handled safely
- All colors are valid hex and distinct

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bborn bborn closed this Feb 2, 2026
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