Hello, I am trying to make an enum with references to Colors from my theme!
enum class Hierarchy(
backgroundColor: Color,
contentColor: Color,
pressedBackgroundColor: Color,
pressedContentColor: Color,
disabledBackgroundColor: Color,
disabledContentColor: Color,
border: BorderStroke? = null,
) {
Primary(
backgroundColor = MyTheme.colors.accentDefault,
contentColor = MyTheme.colors.contentInverse,
disabledBackgroundColor = MyTheme.colors.accentDisabled,
disabledContentColor = MyTheme.colors.contentInverse)
}
But as the enum is not a Composable I am hit with an error
@Composable invocations can only happen from the context of a @Composable function
. Is there a workaround this error?