md-color-menu

0.5.2 • Public • Published

md-color-menu (Angular Material Color Picker) Bower version

Simple color picker based on Angular Material. Colors are pre-defined by the Material Design Color Palette. Try out the Demo.

md-color-menu

Install

Download and install with bower:

bower install md-color-menu --save

Add exported CSS and Javascript:

<link rel="stylesheet" href="bower_components/md-color-menu/md-color-menu.css" />
<script src="bower_components/md-color-menu/md-color-menu.js"></script>

Add the module to your Angular dependencies:

angular.module('myApp', ['mdColorMenu'])

Usage

Define a color on your $scope:

angular
  .module('myApp')
  .controller('Controller', function ($scope, mdPickerColors) {
    $scope.color = mdPickerColors.getColor('#D32F2F'); // pick red as default color
  });

Pass color to <md-color-menu> directive and optionally watch for changes:

<md-color-menu color="color">
  <md-button ng-style="color.style">Change my color</md-button>
</md-color-menu>

Package Sidebar

Install

npm i md-color-menu

Weekly Downloads

1

Version

0.5.2

License

MIT

Unpacked Size

320 kB

Total Files

15

Last publish

Collaborators

  • stilltorik