Thread
#compose
    a

    alorma

    1 year ago
    Hi. Weird question Is it possible, from a module (library), having
    MaterialTheme
    , to obtain the
    light
    or
    dark
    version of a MaterialTheme?
    For example: A module with a method that shows a given composable (via slot) with light or dark variation?
    I have my library
    ComposeDebugDrawer
    , configured like this:
    DebugDrawerLayout(
         drawerColors = YourColorScheme, // darkColors() or lightColors()
    )
    And I would like to always theme my drawer with the dark variation of the app theme
    j

    jaqxues

    1 year ago
    What you probably want is just wrapping it around
    MaterialTheme
    ?
    MaterialTheme(colors = darkColors()) {
        DebugDrawerLayout(...)
    }
    or similar
    a

    alorma

    1 year ago
    Yes, but how to obtain the
    darkColors()
    without recuesting it as a param ?
    j

    jaqxues

    1 year ago
    what is your use case? Since usually you should not pass around these theme colors, but use MaterialTheme {}
    a

    alorma

    1 year ago
    I have a library, that builds a debug drawer, and I would theme it as the local theme, but in dark variation
    Yes, i thougt so, i just wonderd if there's a way to make it automatically
    j

    jaqxues

    1 year ago
    Well in that case you need it as params
    I cannot think of any other way with providers etc to receive a theme with darkColors