fiatjaf on Nostr: This is a good idea: ...
This is a good idea:
NUD: Pubkey to colors
This NUD defines how to convert pubkey to colors.
Live demo
Why?
npub
is nonsense to display.
npub1bla...bla
is nonsense to display.
npub1
takes too much space.
...
means nothing.
Specs
- Uses hex pubkey.
- Converts 64 characters to 8 colors.
- Splits 64 with 8 length chunks.
- Converts each 2 in 8 into
- Alpha (0-255 -> 0.0-1.0)
- Hue (0-255 -> 0.0-360.0)
- Saturation (0-255 -> 0.0-1.0)
- Light (0-255 -> 0.0-1.0)
- Supports dark and light theme.
- When Light is 1.0, flip the Light for light theme (0.0).
I still think it makes sense to display npub1...abcdef when no name is found, but having a standard color for each npub across apps would be a very nice thing.
Published at
2025-01-02 10:57:12Event JSON
{
"id": "00004d42fcf2935a58b30609fc249b31b48c51ecb19db6e726da88cbfdc79038",
"pubkey": "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d",
"created_at": 1735815432,
"kind": 1,
"tags": [
[
"a",
"30023:3c7d12a6c2f71fe9ca2527216f529a137bb0f2eb018b18f30003933b9532013e:1718894509489",
"wss://purplerelay.com/",
"mention"
],
[
"nonce",
"13835058055282168614",
"16"
]
],
"content": "This is a good idea:\n\nnostr:naddr1qqxnzde38qurjdp4xqungwpeqyt8wumn8ghj7ur4wfcxcetjv4kxz7fwvdhk6tcrqsqqqa28qgsrclgj5mp0w8lfegjjwgt022dpx7as7t4srzcc7vqq8yemj5eqz0s25mqwh\n\nI still think it makes sense to display npub1...abcdef when no name is found, but having a standard color for each npub across apps would be a very nice thing.",
"sig": "75bff7c955a7be11a86b17d3712190a794ebbcd63407ede7ff8fa24b910a6cb19e6c2b11708d4e532b95362529d669c375874e46d633de9e0a95834cb74a482c"
}