# StylePropertyAccessorScope

Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/style/StyleProperty.kt+class:androidx.compose.foundation.style.StylePropertyAccessorScope) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.13.0-rc01) Common/All
- Cmn

  ```
  @ExperimentalFoundationStyleApi
  interface StylePropertyAccessorScope
  ```
Known direct subclasses [StyleResolverScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleResolverScope)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleResolverScope` | The type of the scope of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleResolver#resolve(kotlin.Function1)` that allows the `block` to read the fully resolved values from a style. |

*** ** * ** ***

Provides access to resolved style property values.

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope#anySet(kotlin.collections.Set)(properties: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleProperty<*>>)` Returns `true` if any property in `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope#anySet(kotlin.collections.Set)` is set. | Cmn |
| `T?` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope#getOrNull(androidx.compose.foundation.style.StyleProperty)(property: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleProperty<T>)` Returns the resolved value of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope#getOrNull(androidx.compose.foundation.style.StyleProperty)`, or `null` if it is not set. | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleProperty<*>.https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope#(androidx.compose.foundation.style.StyleProperty).isSet()` Returns `true` if a value is explicitly set for this `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleProperty`. | Cmn |
| `T` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleProperty<T>.https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope#(androidx.compose.foundation.style.StyleProperty).value()` Returns the resolved value of this `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleProperty`, or its default value if not set. | Cmn |

| ### Extension functions |
|---|---|---|
| `inline T` | `@https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ExperimentalFoundationStyleApi <T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope.https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope#(androidx.compose.foundation.style.StylePropertyAccessorScope).getOrElse(androidx.compose.foundation.style.StyleProperty,kotlin.Function0)( property: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleProperty<T>, crossinline defaultValue: () -> T )` Returns the resolved value of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).getOrElse(androidx.compose.foundation.style.StyleProperty,kotlin.Function0)` if set, or the result of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).getOrElse(androidx.compose.foundation.style.StyleProperty,kotlin.Function0)`. | Cmn |
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ExperimentalFoundationStyleApi <T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope.https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSet(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)( property: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleProperty<T>, crossinline block: (T) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Call `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSet(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)` when `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSet(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)` has been provided. | Cmn |
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ExperimentalFoundationStyleApi <R : T, T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope.https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSetAs(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)( property: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleProperty<T>, crossinline block: (R) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Call `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSetAs(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)` when `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSetAs(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)` has been provided and the value is of type `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSetAs(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)`. | Cmn |

| ### Extension properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush?` | `@https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ExperimentalFoundationStyleApi https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope.https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope#(androidx.compose.foundation.style.StylePropertyAccessorScope).contentBrush()` Transitionary value. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `@https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ExperimentalFoundationStyleApi https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope.https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope#(androidx.compose.foundation.style.StylePropertyAccessorScope).contentColor()` Transitionary value. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill` | `@https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ExperimentalFoundationStyleApi https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope.https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope#(androidx.compose.foundation.style.StylePropertyAccessorScope).contentFill()` Transitionary value. | Cmn |

## Public functions

### anySet

Cmn

```
fun anySet(properties: Set<StyleProperty<*>>): Boolean
```

Returns `true` if any property in `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope#anySet(kotlin.collections.Set)` is set.

### getOrNull

Cmn Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.13.0-rc01)

```
fun <T : Any?> getOrNull(property: StyleProperty<T>): T?
```

Returns the resolved value of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyAccessorScope#getOrNull(androidx.compose.foundation.style.StyleProperty)`, or `null` if it is not set.

## Public properties

### StyleProperty.isSet

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/style/StyleProperty.kt+symbol:isSet) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.13.0-rc01)

```
val StyleProperty<*>.isSet: Boolean
```

Returns `true` if a value is explicitly set for this `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleProperty`.

### StyleProperty.value

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/style/StyleProperty.kt+symbol:value)

```
val StyleProperty<T>.value: T
```

Returns the resolved value of this `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleProperty`, or its default value if not set.

## Extension functions

### StylePropertyAccessorScope.getOrElse

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/style/StyleProperty.kt+function:getOrElse)

```
@ExperimentalFoundationStyleApi
inline fun <T : Any?> StylePropertyAccessorScope.getOrElse(
    property: StyleProperty<T>,
    crossinline defaultValue: () -> T
): T
```

Returns the resolved value of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).getOrElse(androidx.compose.foundation.style.StyleProperty,kotlin.Function0)` if set, or the result of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).getOrElse(androidx.compose.foundation.style.StyleProperty,kotlin.Function0)`.

| Parameters |
|---|---|
| `property: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleProperty<T>` | property to retrieve |
| `crossinline defaultValue: () -> T` | fallback calculation when `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).getOrElse(androidx.compose.foundation.style.StyleProperty,kotlin.Function0)` is not set |

### StylePropertyAccessorScope.ifSet

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/style/StyleProperty.kt+function:ifSet)

```
@ExperimentalFoundationStyleApi
inline fun <T : Any?> StylePropertyAccessorScope.ifSet(
    property: StyleProperty<T>,
    crossinline block: (T) -> Unit
): Unit
```

Call `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSet(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)` when `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSet(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)` has been provided.

| Parameters |
|---|---|
| `property: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleProperty<T>` | the property to check. |
| `crossinline block: (T) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | called when `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSet(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)` has been provided and is called with the resolved value of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSet(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)` as a parameter. |

### StylePropertyAccessorScope.ifSetAs

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/style/StyleProperty.kt+function:ifSetAs)

```
@ExperimentalFoundationStyleApi
inline fun <R : T, T : Any?> StylePropertyAccessorScope.ifSetAs(
    property: StyleProperty<T>,
    crossinline block: (R) -> Unit
): Unit
```

Call `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSetAs(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)` when `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSetAs(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)` has been provided and the value is of type `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSetAs(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)`.

| Parameters |
|---|---|
| `<R : T>` | the value of R is required to be. |
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>` | the type of the property inferred from `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSetAs(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)` |
| `property: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleProperty<T>` | the property to check. |
| `crossinline block: (R) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | called when `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSetAs(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)` has been provided and is called with the resolved value of `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StylePropertyAccessorScope).ifSetAs(androidx.compose.foundation.style.StyleProperty,kotlin.Function1)` as a parameter. |

## Extension properties

### StylePropertyAccessorScope.contentBrush

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/style/StyleProperties.kt+symbol:contentBrush) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.13.0-rc01)

```
@ExperimentalFoundationStyleApi
val StylePropertyAccessorScope.contentBrush: Brush?
```

Transitionary value. Do not use. This will be removed before the Styles API is stable.

This gives access to the fill value set by `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ContentColorScope`.

### StylePropertyAccessorScope.contentColor

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/style/StyleProperties.kt+symbol:contentColor) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.13.0-rc01)

```
@ExperimentalFoundationStyleApi
val StylePropertyAccessorScope.contentColor: Color
```

Transitionary value. Do not use. This will be removed before the Styles API is stable.

This gives access to the fill value set by `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ContentColorScope`.

### StylePropertyAccessorScope.contentFill

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/style/StyleProperties.kt+symbol:contentFill) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.13.0-rc01)

```
@ExperimentalFoundationStyleApi
val StylePropertyAccessorScope.contentFill: Fill
```

Transitionary value. Do not use. This will be removed before the Styles API is stable.

This gives access to the fill value set by `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ContentColorScope`.