In case of using Tailwind CSS library
You can set alpha value to 50% this way:
.my-class { background-color: theme('path.to.color' / 50%); }
docs: https://v3.tailwindcss.com/docs/functions-and-directives#theme