TextFieldColors
-
Cmn
class TextFieldColors
Represents the colors of the input text, container, and content (including label, placeholder, leading and trailing icons) used in a text field in different states.
Summary
Public constructors |
|
|---|---|
TextFieldColors(create an instance with arbitrary colors. |
Cmn
|
Public functions |
||
|---|---|---|
Color |
containerColor(enabled: Boolean, isError: Boolean, focused: Boolean)Represents the container color for this text field. |
Cmn
|
TextFieldColors |
copy(Returns a copy of this ChipColors, optionally overriding some of the values. |
Cmn
|
Color |
cursorColor(isError: Boolean)Represents the color used for the cursor of this text field. |
Cmn
|
open operator Boolean |
Cmn
|
|
open Int |
hashCode() |
Cmn
|
Color |
indicatorColor(enabled: Boolean, isError: Boolean, focused: Boolean)Represents the color used for the border indicator of this text field. |
Cmn
|
Color |
labelColor(enabled: Boolean, isError: Boolean, focused: Boolean)Represents the color used for the label of this text field. |
Cmn
|
Color |
leadingIconColor(enabled: Boolean, isError: Boolean, focused: Boolean)Represents the color used for the leading icon of this text field. |
Cmn
|
Color |
placeholderColor(enabled: Boolean, isError: Boolean, focused: Boolean)Represents the color used for the placeholder of this text field. |
Cmn
|
Color |
prefixColor(enabled: Boolean, isError: Boolean, focused: Boolean)Represents the color used for the prefix of this text field. |
Cmn
|
Color |
suffixColor(enabled: Boolean, isError: Boolean, focused: Boolean)Represents the color used for the suffix of this text field. |
Cmn
|
Color |
supportingTextColor(enabled: Boolean, isError: Boolean, focused: Boolean)Represents the colors used for the supporting text of this text field. |
Cmn
|
Color |
Represents the color used for the input field of this text field. |
Cmn
|
Color |
trailingIconColor(enabled: Boolean, isError: Boolean, focused: Boolean)Represents the color used for the trailing icon of this text field. |
Cmn
|
Public properties |
||
|---|---|---|
Color |
the cursor color for this text field |
Cmn
|
Color |
the container color for this text field when disabled |
Cmn
|
Color |
the indicator color for this text field when disabled |
Cmn
|
Color |
the label color for this text field when disabled |
Cmn
|
Color |
the leading icon color for this text field when disabled |
Cmn
|
Color |
the placeholder color for this text field when disabled |
Cmn
|
Color |
the prefix color for this text field when disabled |
Cmn
|
Color |
the suffix color for this text field when disabled |
Cmn
|
Color |
the supporting text color for this text field when disabled |
Cmn
|
Color |
the color used for the input text of this text field when disabled |
Cmn
|
Color |
the trailing icon color for this text field when disabled |
Cmn
|
Color |
the container color for this text field when in error state |
Cmn
|
Color |
the cursor color for this text field when in error state |
Cmn
|
Color |
the indicator color for this text field when in error state |
Cmn
|
Color |
the label color for this text field when in error state |
Cmn
|
Color |
the leading icon color for this text field when in error state |
Cmn
|
Color |
the placeholder color for this text field when in error state |
Cmn
|
Color |
the prefix color for this text field when in error state |
Cmn
|
Color |
the suffix color for this text field when in error state |
Cmn
|
Color |
the supporting text color for this text field when in error state |
Cmn
|
Color |
the color used for the input text of this text field when in error state |
Cmn
|
Color |
the trailing icon color for this text field when in error state |
Cmn
|
Color |
the container color for this text field when focused |
Cmn
|
Color |
the indicator color for this text field when focused |
Cmn
|
Color |
the label color for this text field when focused |
Cmn
|
Color |
the leading icon color for this text field when focused |
Cmn
|
Color |
the placeholder color for this text field when focused |
Cmn
|
Color |
the prefix color for this text field when focused |
Cmn
|
Color |
the suffix color for this text field when focused |
Cmn
|
Color |
the supporting text color for this text field when focused |
Cmn
|
Color |
the color used for the input text of this text field when focused |
Cmn
|
Color |
the trailing icon color for this text field when focused |
Cmn
|
TextSelectionColors |
the colors used when the input text of this text field is selected |
Cmn
|
Color |
the container color for this text field when not focused |
Cmn
|
Color |
the indicator color for this text field when not focused |
Cmn
|
Color |
the label color for this text field when not focused |
Cmn
|
Color |
the leading icon color for this text field when not focused |
Cmn
|
Color |
the placeholder color for this text field when not focused |
Cmn
|
Color |
the prefix color for this text field when not focused |
Cmn
|
Color |
the suffix color for this text field when not focused |
Cmn
|
Color |
the supporting text color for this text field when not focused |
Cmn
|
Color |
the color used for the input text of this text field when not focused |
Cmn
|
Color |
the trailing icon color for this text field when not focused |
Cmn
|
Public constructors
TextFieldColors
TextFieldColors(
focusedTextColor: Color,
unfocusedTextColor: Color,
disabledTextColor: Color,
errorTextColor: Color,
focusedContainerColor: Color,
unfocusedContainerColor: Color,
disabledContainerColor: Color,
errorContainerColor: Color,
cursorColor: Color,
errorCursorColor: Color,
textSelectionColors: TextSelectionColors,
focusedIndicatorColor: Color,
unfocusedIndicatorColor: Color,
disabledIndicatorColor: Color,
errorIndicatorColor: Color,
focusedLeadingIconColor: Color,
unfocusedLeadingIconColor: Color,
disabledLeadingIconColor: Color,
errorLeadingIconColor: Color,
focusedTrailingIconColor: Color,
unfocusedTrailingIconColor: Color,
disabledTrailingIconColor: Color,
errorTrailingIconColor: Color,
focusedLabelColor: Color,
unfocusedLabelColor: Color,
disabledLabelColor: Color,
errorLabelColor: Color,
focusedPlaceholderColor: Color,
unfocusedPlaceholderColor: Color,
disabledPlaceholderColor: Color,
errorPlaceholderColor: Color,
focusedSupportingTextColor: Color,
unfocusedSupportingTextColor: Color,
disabledSupportingTextColor: Color,
errorSupportingTextColor: Color,
focusedPrefixColor: Color,
unfocusedPrefixColor: Color,
disabledPrefixColor: Color,
errorPrefixColor: Color,
focusedSuffixColor: Color,
unfocusedSuffixColor: Color,
disabledSuffixColor: Color,
errorSuffixColor: Color
)
create an instance with arbitrary colors. See TextFieldDefaults.colors for the default colors used in TextField. See OutlinedTextFieldDefaults.colors for the default colors used in OutlinedTextField.
| Parameters | |
|---|---|
focusedTextColor: Color |
the color used for the input text of this text field when focused |
unfocusedTextColor: Color |
the color used for the input text of this text field when not focused |
disabledTextColor: Color |
the color used for the input text of this text field when disabled |
errorTextColor: Color |
the color used for the input text of this text field when in error state |
focusedContainerColor: Color |
the container color for this text field when focused |
unfocusedContainerColor: Color |
the container color for this text field when not focused |
disabledContainerColor: Color |
the container color for this text field when disabled |
errorContainerColor: Color |
the container color for this text field when in error state |
cursorColor: Color |
the cursor color for this text field |
errorCursorColor: Color |
the cursor color for this text field when in error state |
textSelectionColors: TextSelectionColors |
the colors used when the input text of this text field is selected |
focusedIndicatorColor: Color |
the indicator color for this text field when focused |
unfocusedIndicatorColor: Color |
the indicator color for this text field when not focused |
disabledIndicatorColor: Color |
the indicator color for this text field when disabled |
errorIndicatorColor: Color |
the indicator color for this text field when in error state |
focusedLeadingIconColor: Color |
the leading icon color for this text field when focused |
unfocusedLeadingIconColor: Color |
the leading icon color for this text field when not focused |
disabledLeadingIconColor: Color |
the leading icon color for this text field when disabled |
errorLeadingIconColor: Color |
the leading icon color for this text field when in error state |
focusedTrailingIconColor: Color |
the trailing icon color for this text field when focused |
unfocusedTrailingIconColor: Color |
the trailing icon color for this text field when not focused |
disabledTrailingIconColor: Color |
the trailing icon color for this text field when disabled |
errorTrailingIconColor: Color |
the trailing icon color for this text field when in error state |
focusedLabelColor: Color |
the label color for this text field when focused |
unfocusedLabelColor: Color |
the label color for this text field when not focused |
disabledLabelColor: Color |
the label color for this text field when disabled |
errorLabelColor: Color |
the label color for this text field when in error state |
focusedPlaceholderColor: Color |
the placeholder color for this text field when focused |
unfocusedPlaceholderColor: Color |
the placeholder color for this text field when not focused |
disabledPlaceholderColor: Color |
the placeholder color for this text field when disabled |
errorPlaceholderColor: Color |
the placeholder color for this text field when in error state |
focusedSupportingTextColor: Color |
the supporting text color for this text field when focused |
unfocusedSupportingTextColor: Color |
the supporting text color for this text field when not focused |
disabledSupportingTextColor: Color |
the supporting text color for this text field when disabled |
errorSupportingTextColor: Color |
the supporting text color for this text field when in error state |
focusedPrefixColor: Color |
the prefix color for this text field when focused |
unfocusedPrefixColor: Color |
the prefix color for this text field when not focused |
disabledPrefixColor: Color |
the prefix color for this text field when disabled |
errorPrefixColor: Color |
the prefix color for this text field when in error state |
focusedSuffixColor: Color |
the suffix color for this text field when focused |
unfocusedSuffixColor: Color |
the suffix color for this text field when not focused |
disabledSuffixColor: Color |
the suffix color for this text field when disabled |
errorSuffixColor: Color |
the suffix color for this text field when in error state |
Public functions
containerColor
fun containerColor(enabled: Boolean, isError: Boolean, focused: Boolean): Color
Represents the container color for this text field.
copy
fun copy(
focusedTextColor: Color = this.focusedTextColor,
unfocusedTextColor: Color = this.unfocusedTextColor,
disabledTextColor: Color = this.disabledTextColor,
errorTextColor: Color = this.errorTextColor,
focusedContainerColor: Color = this.focusedContainerColor,
unfocusedContainerColor: Color = this.unfocusedContainerColor,
disabledContainerColor: Color = this.disabledContainerColor,
errorContainerColor: Color = this.errorContainerColor,
cursorColor: Color = this.cursorColor,
errorCursorColor: Color = this.errorCursorColor,
textSelectionColors: TextSelectionColors? = this.textSelectionColors,
focusedIndicatorColor: Color = this.focusedIndicatorColor,
unfocusedIndicatorColor: Color = this.unfocusedIndicatorColor,
disabledIndicatorColor: Color = this.disabledIndicatorColor,
errorIndicatorColor: Color = this.errorIndicatorColor,
focusedLeadingIconColor: Color = this.focusedLeadingIconColor,
unfocusedLeadingIconColor: Color = this.unfocusedLeadingIconColor,
disabledLeadingIconColor: Color = this.disabledLeadingIconColor,
errorLeadingIconColor: Color = this.errorLeadingIconColor,
focusedTrailingIconColor: Color = this.focusedTrailingIconColor,
unfocusedTrailingIconColor: Color = this.unfocusedTrailingIconColor,
disabledTrailingIconColor: Color = this.disabledTrailingIconColor,
errorTrailingIconColor: Color = this.errorTrailingIconColor,
focusedLabelColor: Color = this.focusedLabelColor,
unfocusedLabelColor: Color = this.unfocusedLabelColor,
disabledLabelColor: Color = this.disabledLabelColor,
errorLabelColor: Color = this.errorLabelColor,
focusedPlaceholderColor: Color = this.focusedPlaceholderColor,
unfocusedPlaceholderColor: Color = this.unfocusedPlaceholderColor,
disabledPlaceholderColor: Color = this.disabledPlaceholderColor,
errorPlaceholderColor: Color = this.errorPlaceholderColor,
focusedSupportingTextColor: Color = this.focusedSupportingTextColor,
unfocusedSupportingTextColor: Color = this.unfocusedSupportingTextColor,
disabledSupportingTextColor: Color = this.disabledSupportingTextColor,
errorSupportingTextColor: Color = this.errorSupportingTextColor,
focusedPrefixColor: Color = this.focusedPrefixColor,
unfocusedPrefixColor: Color = this.unfocusedPrefixColor,
disabledPrefixColor: Color = this.disabledPrefixColor,
errorPrefixColor: Color = this.errorPrefixColor,
focusedSuffixColor: Color = this.focusedSuffixColor,
unfocusedSuffixColor: Color = this.unfocusedSuffixColor,
disabledSuffixColor: Color = this.disabledSuffixColor,
errorSuffixColor: Color = this.errorSuffixColor
): TextFieldColors
Returns a copy of this ChipColors, optionally overriding some of the values. This uses the Color.Unspecified to mean “use the value from the source”
cursorColor
fun cursorColor(isError: Boolean): Color
Represents the color used for the cursor of this text field.
| Parameters | |
|---|---|
isError: Boolean |
whether the text field's current value is in error |
indicatorColor
fun indicatorColor(enabled: Boolean, isError: Boolean, focused: Boolean): Color
Represents the color used for the border indicator of this text field.
labelColor
fun labelColor(enabled: Boolean, isError: Boolean, focused: Boolean): Color
Represents the color used for the label of this text field.
leadingIconColor
fun leadingIconColor(enabled: Boolean, isError: Boolean, focused: Boolean): Color
Represents the color used for the leading icon of this text field.
placeholderColor
fun placeholderColor(enabled: Boolean, isError: Boolean, focused: Boolean): Color
Represents the color used for the placeholder of this text field.
prefixColor
fun prefixColor(enabled: Boolean, isError: Boolean, focused: Boolean): Color
Represents the color used for the prefix of this text field.
suffixColor
fun suffixColor(enabled: Boolean, isError: Boolean, focused: Boolean): Color
Represents the color used for the suffix of this text field.
supportingTextColor
fun supportingTextColor(enabled: Boolean, isError: Boolean, focused: Boolean): Color
Represents the colors used for the supporting text of this text field.
textColor
fun textColor(enabled: Boolean, isError: Boolean, focused: Boolean): Color
Represents the color used for the input field of this text field.
trailingIconColor
fun trailingIconColor(enabled: Boolean, isError: Boolean, focused: Boolean): Color
Represents the color used for the trailing icon of this text field.
Public properties
disabledContainerColor
val disabledContainerColor: Color
the container color for this text field when disabled
disabledIndicatorColor
val disabledIndicatorColor: Color
the indicator color for this text field when disabled
disabledLeadingIconColor
val disabledLeadingIconColor: Color
the leading icon color for this text field when disabled
disabledPlaceholderColor
val disabledPlaceholderColor: Color
the placeholder color for this text field when disabled
disabledPrefixColor
val disabledPrefixColor: Color
the prefix color for this text field when disabled
disabledSuffixColor
val disabledSuffixColor: Color
the suffix color for this text field when disabled
disabledSupportingTextColor
val disabledSupportingTextColor: Color
the supporting text color for this text field when disabled
disabledTextColor
val disabledTextColor: Color
the color used for the input text of this text field when disabled
disabledTrailingIconColor
val disabledTrailingIconColor: Color
the trailing icon color for this text field when disabled
errorContainerColor
val errorContainerColor: Color
the container color for this text field when in error state
errorCursorColor
val errorCursorColor: Color
the cursor color for this text field when in error state
errorIndicatorColor
val errorIndicatorColor: Color
the indicator color for this text field when in error state
errorLeadingIconColor
val errorLeadingIconColor: Color
the leading icon color for this text field when in error state
errorPlaceholderColor
val errorPlaceholderColor: Color
the placeholder color for this text field when in error state
errorPrefixColor
val errorPrefixColor: Color
the prefix color for this text field when in error state
errorSuffixColor
val errorSuffixColor: Color
the suffix color for this text field when in error state
errorSupportingTextColor
val errorSupportingTextColor: Color
the supporting text color for this text field when in error state
errorTextColor
val errorTextColor: Color
the color used for the input text of this text field when in error state
errorTrailingIconColor
val errorTrailingIconColor: Color
the trailing icon color for this text field when in error state
focusedContainerColor
val focusedContainerColor: Color
the container color for this text field when focused
focusedIndicatorColor
val focusedIndicatorColor: Color
the indicator color for this text field when focused
focusedLeadingIconColor
val focusedLeadingIconColor: Color
the leading icon color for this text field when focused
focusedPlaceholderColor
val focusedPlaceholderColor: Color
the placeholder color for this text field when focused
focusedSupportingTextColor
val focusedSupportingTextColor: Color
the supporting text color for this text field when focused
focusedTextColor
val focusedTextColor: Color
the color used for the input text of this text field when focused
focusedTrailingIconColor
val focusedTrailingIconColor: Color
the trailing icon color for this text field when focused
textSelectionColors
val textSelectionColors: TextSelectionColors
the colors used when the input text of this text field is selected
unfocusedContainerColor
val unfocusedContainerColor: Color
the container color for this text field when not focused
unfocusedIndicatorColor
val unfocusedIndicatorColor: Color
the indicator color for this text field when not focused
unfocusedLabelColor
val unfocusedLabelColor: Color
the label color for this text field when not focused
unfocusedLeadingIconColor
val unfocusedLeadingIconColor: Color
the leading icon color for this text field when not focused
unfocusedPlaceholderColor
val unfocusedPlaceholderColor: Color
the placeholder color for this text field when not focused
unfocusedPrefixColor
val unfocusedPrefixColor: Color
the prefix color for this text field when not focused
unfocusedSuffixColor
val unfocusedSuffixColor: Color
the suffix color for this text field when not focused
unfocusedSupportingTextColor
val unfocusedSupportingTextColor: Color
the supporting text color for this text field when not focused
unfocusedTextColor
val unfocusedTextColor: Color
the color used for the input text of this text field when not focused
unfocusedTrailingIconColor
val unfocusedTrailingIconColor: Color
the trailing icon color for this text field when not focused