JSFiddle - React, Tailwind, and code Playground
HTML
<div class="post">
hello
</div>
JavaScript
postID = 1/* get your post ID as int */
/* gets a number between 1 and 25 from your post ID */
colourID = (postID % 25) + 1
/* this tells which step to use for each colour */
base3ColourID = colourID.toString(3)
/* this always returns 3 digits */
niceB3CID = ("000").substring(base3ColourID.length) + base3ColourID
red = 125 + 50*(parseInt(niceB3CID.charAt(0)))
green = 125 + 50*(parseInt(niceB3CID.charAt(1)))
blue = 125 + 50*(parseInt(niceB3CID.charAt(2)))
$('.post').css('background-color', "rgb("+red+","+green+","+blue+")")