My Profile Photo

Sheogorath's Blog

Calculate MXID colours

Today I learned that the colour for names in the Matrix client “Element” is calculated using an array of 8 pre-defined colour codes and a simple hash algorithm that distributes the colours a bit, based on the MXID.

I came across this due to a discussion in “Bloggers Gathering”, a matrix room I provide, where people discussed where the different colours for the users come from and cadence shared their page which can pre-calculate the colour for your MXID.