The Colorspacious Python library [3] does a proper job, using the algorithm of Machado et al. (2009) [4], which is what's considered state-of-the-art.
[1] https://github.com/MaPePeR/jsColorblindSimulator#the-colorma... [2] https://hg.mozilla.org/mozilla-central/annotate/tip/devtools... [3] https://colorspacious.readthedocs.io/en/latest/tutorial.html... [4] https://doi.org/10.1109/TVCG.2009.113