Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yegor256/colorizejs
jQuery plugin to colorize data elements
https://github.com/yegor256/colorizejs
javascript jquery jquery-plugin
Last synced: about 2 months ago
JSON representation
jQuery plugin to colorize data elements
- Host: GitHub
- URL: https://github.com/yegor256/colorizejs
- Owner: yegor256
- License: mit
- Created: 2018-07-22T09:08:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-10T21:38:13.000Z (4 months ago)
- Last Synced: 2024-09-26T00:24:57.658Z (3 months ago)
- Topics: javascript, jquery, jquery-plugin
- Language: JavaScript
- Homepage: https://yegor256.github.io/colorizejs
- Size: 444 KB
- Stars: 8
- Watchers: 4
- Forks: 3
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/colorizejs)](http://www.rultor.com/p/yegor256/colorizejs)
[![Build Status](https://travis-ci.org/yegor256/colorizejs.svg)](https://travis-ci.org/yegor256/colorizejs)
[![PDD status](http://www.0pdd.com/svg?name=yegor256/colorizejs)](http://www.0pdd.com/p?name=yegor256/colorizejs)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/colorizejs/blob/master/LICENSE.txt)
[![NPM version](https://badge.fury.io/js/colorizejs.svg)](http://badge.fury.io/js/colorizejs)It's a simple [jQuery](https://jquery.com/) plugin
to colorize data elements according to their values:```javascript
$('#foo').colorizejs({ 500: 'green', 0: 'red' });
```If the value of `#foo` is larger than 500, its color will be set to `green`,
if it is larger than zero, it will be set to `red`,
otherwise it won't be touched.You can also use classes instead of colors by prepending them with a dot:
```javascript
$('#foo').colorizejs({ 500: '.green', 0: '.red' });
```The easiest way is to just include it in your HTML from the
[RawGit CDN](https://rawgit.com/):```html
```
Otherwise, you can download the
[latest release](https://github.com/yegor256/colorizejs/releases).You can also install it with npm:
```bash
$ npm install colorizejs
```## How to Contribute
First, make sure you can build it locally:
```bash
$ npm install --global gulp-cli
$ gulp
```The build has to be clean. If it's not, [submit an issue](https://github.com/yegor256/colorizejs/issues).
Then, make your changes, make sure the build is still clean,
and [submit a pull request](https://www.yegor256.com/2014/04/15/github-guidelines.html).