OudsColoredBox

fun OudsColoredBox(color: OudsColoredBoxColor, modifier: Modifier = Modifier, contentAlignment: Alignment = Alignment.TopStart, propagateMinConstraints: Boolean = false, content: @Composable BoxScope.() -> Unit)

A colored box is a Box where content color is automatically adjusted to maximize the contrast with the chosen background color.

Moreover, the colors of several OUDS Android components (for instance OudsButton or OudsLink) are also automatically adjusted. Some tokens associated with these specific colors can be customized and are grouped into Mono tokens classes (for instance com.orange.ouds.theme.tokens.components.OudsButtonMonoTokens).

Parameters

color

The background color of the colored box.

modifier

Modifier to be applied to the layout corresponding to the colored box.

contentAlignment

The default Alignment inside the colored box.

propagateMinConstraints

Whether the incoming min constraints should be passed to content.

content

The content of this colored box.

Samples

import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.PreviewLightDark
import com.orange.ouds.core.component.OudsColoredBox
import com.orange.ouds.core.component.OudsColoredBoxColor
import com.orange.ouds.core.utilities.OudsPreview

fun main() { 
   //sampleStart 
   OudsColoredBox(color = OudsColoredBoxColor.StatusInfoEmphasized) {
    // From this point the theme is automatically adjusted to maximize the contrast with OudsColoredBoxColor.StatusInfoEmphasized
    Text("Text")
} 
   //sampleEnd
}