Who are Hue?

Npub-derived colors that we can actually use.
Who are Hue?

Colors as a fun and useful identifier

Nostr apps often use totally random colors for their default avatars, profiles names in chat bubbles, etc… That’s a missed opportunity. Why don’t we just we just derive a color from the npub and use that instead, interoperably across apps?

It gives us a fun and visual extra point of recognition, often without having to add anything extra to the UIs.

The only problem is that we cannot just allow for any color. The colors should be readable as text in Light and Dark modes and gray-scales should be avoided too.

This is the goal: Color Test in Light and Dark Mode Luckily, there’s a super simple solution.
(which was used to derive the colors above)

Deriving the Colors

You can find the simple spec here:

Niel Liesmons
Jan 22, 2026 14:14

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

  1. Convert HEX pubkey to integer
  2. Calculate Hue: integer % 360
  3. Set Saturation to 70%
  4. Set Value/Brightness based on Hue:
    • 75% for Hue 32–204
    • 96% for Hue 216–273
    • 90% otherwise
  5. 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%

TLDR:

  1. Convert HEX pubkey to Int
  2. Calculate the Hue value: Int % 360
  3. Set Saturation to 90 for Hues between 216 and 273, use 80 for the rest
  4. Set Brightness to 65 for Hues between 32 and 212, use 85 for the rest

Convert HSB color to whatever format you need. Done.

Easy & Fun to integrate!

No comments yet.