Stay organized with collections
Save and categorize content based on your preferences.
ColorRoles
public
final
class
ColorRoles
extends Object
java.lang.Object
|
↳ |
com.google.android.material.color.ColorRoles
|
Each accent color (primary, secondary and tertiary), is provided as a group of four supplementary
color roles with different luminance which can be used in the UI to define emphasis and to
provide a greater flexibility in expression.
Summary
Public methods |
int
|
getAccent()
Returns the accent color, used as the main color from the color role.
|
int
|
getAccentContainer()
Returns the accent_container color, used with less emphasis than the accent color.
|
int
|
getOnAccent()
Returns the on_accent color, used for content such as icons and text on top of the Accent
color.
|
int
|
getOnAccentContainer()
Returns the on_accent_container color, used for content such as icons and text on top of the
accent_container color.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public methods
getAccent
public int getAccent ()
Returns the accent color, used as the main color from the color role.
getAccentContainer
public int getAccentContainer ()
Returns the accent_container color, used with less emphasis than the accent color.
getOnAccent
public int getOnAccent ()
Returns the on_accent color, used for content such as icons and text on top of the Accent
color.
getOnAccentContainer
public int getOnAccentContainer ()
Returns the on_accent_container color, used for content such as icons and text on top of the
accent_container color.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ColorRoles\n\nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nColorRoles\n==========\n\n\n`\npublic\n\nfinal\n\nclass\nColorRoles\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|----------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.google.android.material.color.ColorRoles |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nEach accent color (primary, secondary and tertiary), is provided as a group of four supplementary\ncolor roles with different luminance which can be used in the UI to define emphasis and to\nprovide a greater flexibility in expression.\n\nSummary\n-------\n\n| ### Public methods ||\n|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` int` | ` `[getAccent](/reference/com/google/android/material/color/ColorRoles#getAccent())`() ` Returns the accent color, used as the main color from the color role. |\n| ` int` | ` `[getAccentContainer](/reference/com/google/android/material/color/ColorRoles#getAccentContainer())`() ` Returns the accent_container color, used with less emphasis than the accent color. |\n| ` int` | ` `[getOnAccent](/reference/com/google/android/material/color/ColorRoles#getOnAccent())`() ` Returns the on_accent color, used for content such as icons and text on top of the Accent color. |\n| ` int` | ` `[getOnAccentContainer](/reference/com/google/android/material/color/ColorRoles#getOnAccentContainer())`() ` Returns the on_accent_container color, used for content such as icons and text on top of the accent_container color. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nPublic methods\n--------------\n\n### getAccent\n\n```\npublic int getAccent ()\n```\n\nReturns the accent color, used as the main color from the color role.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### getAccentContainer\n\n```\npublic int getAccentContainer ()\n```\n\nReturns the accent_container color, used with less emphasis than the accent color.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### getOnAccent\n\n```\npublic int getOnAccent ()\n```\n\nReturns the on_accent color, used for content such as icons and text on top of the Accent\ncolor.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### getOnAccentContainer\n\n```\npublic int getOnAccentContainer ()\n```\n\nReturns the on_accent_container color, used for content such as icons and text on top of the\naccent_container color.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |"]]