nip-c1
Profile Colors
A proposal for pubkey-derived colors that can be used as unique profile colors.
This simple spec is optimized for the usability and readability of the colors in actual UIs: as text (profile name), as backgrounds, as indicator dots, as borders, etc.
Works in dark, grey, sepia, ivory, light, etc. modes.
Color Derivation
- Convert HEX pubkey to integer
- Calculate Hue:
integer % 360 - Set Saturation to 70%
- Set Value/Brightness based on Hue:
- 75% for Hue 32–204
- 96% for Hue 216–273
- 90% otherwise
- Convert HSV to RGB
Text Adjustment
When using the profile color for text (author names, mentions, etc.), adjust brightness for readability:
- Dark mode: increase brightness by 8%
- Light mode: decrease brightness by 5%
Write a comment