Skip to content

evert0n/angular-color-contrast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AngularJS Color Contrast Directive

Automatically set the text color based on the background.

Helps you display things like colored labels.

Demo

http://evert0n.github.io/angular-color-contrast/

Usage

Install with Bower

$bower install angular-color-contrast

Include this component into your app

<script src="color-contrast.js"></script>

Inject colorContrast as a module dependency to your app.

var myApp = angular.module('myApp', ['colorContrast']);

Pass the background color of element to get the right color contrast for the text.

<div ng-show="labels" class="labels">
  <a ng-repeat="label in labels" href="#" target="_blank">
    <span class="label" color-contrast="{{label.color}}">{{label.name}}</span>
  </a> 
</div>

License

MIT License

About

AngularJS Color Contrast Directive

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published