Tutorialsplane

Materialize Color


Materialize Color: Materialize provides rich predefined colors. These colors are based on Material Design base colors. Colors in Materialize are defined with a base color class and an optional class which can be used for lighten or darken. Here in this tutorial we are going to explain how you can use colors in using the predefined classes in Materialize.


Materialize Color Usage | Example

Let us go step by step to understand the colors in Materialize –

Background Color

You can add the background color just add the color name and lightness/brightness as the class to the element. Here is an example to add background color in Materialize.

Materialize Add Background Color Example:

<div class="card-panel teal lighten-2">Background Color Example.</div>      

Try it »

If you run the above example it will produce the output something like this –

Text Color

To change text color you just need to append “-text” in color classes. Let us create an example to change the color of the text.

Text Color Change in Materialize:

<div class="yellow-text text-darken-2">Text Color Example.</div>      

Try it »

If you run the above example it will produce output something like this –

Colors

Following colors are available which you can use with lightness/darkness-

Lightness/Darkness

Following Lightness/Darkness classes Are available which can be used to apply darkness or lightness in color.


Learn More

Let us have some more example and demo about the Materialize Colors.


Basic Colors

Let us create an example of basic colors listed above-

Materialize Add Background Color Example:

  • red
  • pink
  • purple
  • deep-purple
  • blue
  • indigo
  • light-blue
  • teal
  • cyan
  • green
  • light-green
  • lime
  • yellow
  • amber
  • orange
  • deep-orange
  • brown
  • grey
  • blue-grey
  • black
  • white
  • transparent

Try it »

If you run the above example it will produce the output something like this –


Now let us Understand how lightness and darkness works.

Lightness/Darkness Example

Here let us pick one color let us say “blue” and add lightness/darkness classes to see how it works-

Materialize Lightness | Darkness Color Example:

  • Blue
  • Blue lighten-1
  • Blue lighten-2
  • Blue lighten-3
  • Blue lighten-4
  • Blue lighten-5
  • Blue darken-1
  • Blue darken-2
  • Blue darken-3
  • Blue darken-4
  • Blue accent-1
  • Blue accent-2
  • Blue accent-3
  • Blue accent-4

Try it »

If you run the above example it will produce the output something like this –

Materialize Tutorial

Css

Component

JavaScript