JSFiddle - React, Tailwind, and code Playground
HTML
<select id='S1' style='background-color:#25F0FF;'>
<option value='0' style='background-color:#25F0FF;'>bleu clair</option>
<option value='1' style='background-color:#0000FF;' >bleu</option>
<option value='2' style='background-color:#FF0000;' >rouge</option>
<option value='3' style='background-color:#00FF00;' >Vert</option>
<option value='4' style='background-color:#000000;' >Noir</option>
</select>
JavaScript
$('#S1 option').each(function () {
$(this).data('rgb', $(this).css('background-color'))
})
$("#S1").change(function () {
me = $(this);
var selcol = $(this).find(':selected').data('rgb');
// console.log(selcol) // affiche bien le rgb
$(this).css("background-color", selcol);
});