I've googled everywhere and can't find any resource or page that goes in to how to accomplish this. Most results just work with rgba() etc.
What I want exactly: To convert a 8-Digit hex with transparency to a 6-Digit hex with the transparency applied (assuming a white background).
For example: I have the following colors:
#14C4C1FD
#F25021F4
#FE7162FD
#A259FFFD
#6A9A9C60
#28B8ABBB
#5B9CB931
I want to flatten these colors, so that I get a resulting list of 6-Digit hex codes that reflect the visible color when the transparency is applied. I don't want to just trim the last two digits and remove the transparency.
Here is an image for a more clear reference to what I'm trying to accomplish:
As mentioned in the image, an algorithm would be great. I am using PowerShell but really I'll take any algorithm in any language and just port it myself.

Direct conversion from the
#RRGGBBAAformat to#RRGGBBis not straightforward. To accomplish this, you must initially transform the#RRGGBBAAcolour format intoRGBA. This involves removing transparency from the colour, and subsequently, you can convert the resultingRGBvalues back into the Hex format.Here is a simple algorithm for your use case in Python: