I want to use custom colors defined in the colors.xml class directly without using the Material theme colors or the default theme provided by the Jetpack. Is there any straightforward way to do it?
You can use colorResource()
which loads a color resource.
Text(
text = "Hello World",
color = colorResource(R.color.purple_200)
)