Well the webpage will be in an RGB colourspace, of course, and the model will be hexadecimal, as is the case with basically all HTML (this site is CSS based, of course) so mapping can be a manual task, can use colour model system tools of various kinds, could use Adobe's Illustrator's recolour tools, or any other systematic approach. I might well use galactic.ink/sphere to do this.
Bear in mind that the recolour tool, and the sphere tool, allow you to set a custom scheme, and then with your scheme set, alter the hue angle of the primary tone and it shifts the whole sequence, keeping relative hue angles, value shifts and contrast all constant between new versions of that basic scheme; though clearly this is not algorithmic, I think it gets you the function you need for now, and might be a starting point for a coding effort to create an algorithmic system.
Sphere colour position 01
Sphere - same scheme rotated to position 02
Same relationships - different colour scheme.
The same approach but more flexibly implemented in Adobe Illustrator's recolour tools (allows your custom schemes easily):
Illustrator file with one colour swatch group, each swatch applied to one rectangle:
Rectangles alt-drag copied, with them still selected, Colour Guide invoked:
Click in New Group at right upper bezel:
You can name your new group if you wish - then click on the Edit button at mid-pane left:
This brings up the colour sphere editor, which has your scheme loaded into the nodes, and the unbroken chain at bottom right of the colour sphere editor pane indicates the relationships will be enforced if you change hue angle or value:
Rotate the hue angle of one of the nodes or the primary node and they all move. Shift in/out to change value, and again, they all maintain relative positions... once you have something which you feel meets your needs for a new scheme, on the right-hand pane click the "Save to disk" symbol and the changes you've made will be saved in your new group.
As you can see, this has also recoloured your selected items to your new scheme as well.
When you exit the Colour Guide, the new group you created is visible in your basic swatches palette also.