'opacity of color passed as props Styled component

I was trying to edit the opacity of color passed as props, I can do it with sass like that

background: rgba($primary, 0.2);

I try to do the same with the styled-component, but is not working.

`background-color: rgba(${(props) => props.theme.primary}, 0.8);`


Solution 1:[1]

I fix it but not what I was waiting for, you need to use costume property.

 primary = "96, 113, 201";

`background-color: rgba(${(props) => props.theme.primary}, 0.8);`

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 zougari47