You can for example create a table in the database with the following field:
user table
user id = 12345678
user_name = 'fer'; Home
color="#FFF";
and on your form it will make a record in this table, where color will be the color chosen by the user at the time of registration.
When you fetch that user's data into the database, you search the color for the id and assign it to a variable, for example:
It is worth mentioning that the way in which you will search the database for the variable "color" depends on what technology you are using (mysql, mysqli, PDO and others)
$query = select cor from usuario where id_usuario = 12345678
$resource= mysql_query($query);
$resultado = mysql_fetch_array($resource);
$cor = $resultado['cor'];
To assign this variable to a div, for example, the code is this:
<div style="background-color: <?php echo $cor; ?>"><p>Minha div com a cor escolhida pelo usuário! </p></div>