Skip to content

emnajaoua/md-color-menu

 
 

Repository files navigation

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>

About

Simple Angular Material Color Picker

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 64.9%
  • HTML 31.6%
  • CSS 3.5%