Using md-colors
from angular material, is it possible to set the background to white without defining a custom white pallet?
I thought I could use the grey pallet because the documentation says:
background - grey (note that white is in this palette)
So I tried doing
<div md-colors="{background: 'grey-50'}">
but grey-50
is still only a light grey colour, not white.
I tried <div layout-padding md-colors="{background: 'white'}">
but the white pallet doesn't seem to exist in angular material.
I get the error angular.js:13711 mdColors: couldn't find 'white' in the palettes.
, because there is no white pallet.
Is there any way to access the white colour from the grey pallet? ( a hue, opacity etc.)
If not, is there any way to access a white colour from any other pallet using angular material?
If all else fails I could define an entire white pallet/theme and use that, but I would rather avoid doing that if there is a correct way.
White backgrounds: Simple and classic, black text on a white background provides the highest readability ratio. Blues and grays also provide the right contrast and thus work well on white backgrounds.
White as a background color emphasizes clarity and removes visual obstacles and clutter in today's trending use. The hue is used to add visual emphasis to other important parts of the design – color, text or images – and is frequently part of an overall visual aesthetic that is simply designed and minimalistic.
White is not only the best background color for websites, but is also one of the most common. It is neutral, so you can use it with anything. The primary concern with a white background is using darker colors for contrast. Don't use white and a soft yellow, for example, as the text will fade into the background.
You can find all palettes and their colors in the source in the theme file.
It should be A100
but I have not tried it.
<div md-colors="{background: 'grey-A100'}">
You can try giving opacity at your grey-50
. Somtehing like this:
<div md-colors="{background: 'grey-50-0.1'}">
(where 0.1
is the opacity)
Full documentation: https://material.angularjs.org/1.1.2/api/directive/mdColors
You can also take a look of Sander Elias colors and hues using md-colors
found in this plunker. It demonstrate the result of the color class name both for the foreground and background. Hope it may help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With