Skip to content

A conditional formatting (color coding) plugin for jQuery

License

Notifications You must be signed in to change notification settings

tlaanemaa/condiFormat.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

condiFormat

This is a simple plugin for jQuery to allow conditional formatting. It separates the workload into smaller chunks and runs async to avoid keeping the browser busy for too long. The async properties along with other properties can be changed via the options parameter

Usage example
$('table#mainTable td').condiFormat({'midColor': '#FFFFFF'});
Options
  • highColor
    Color of the highest value. Default: #4CAF50
  • midColor
    Color of the middle value. Default: #FFEB3B
  • lowColor
    Color of the lowest value. Default: #F44336
  • midPoint
    Value representing where the middle value will be at (percentage). Default: 0.5
  • opacity
    Opacity of the background-color that will be set. Default: 1
  • invertColorAt
    Color code sums (red + green + blue) under this value will have their text color convered to white. Default: 400
  • readBatchSize
    Items to read in one batch before allowing browser to take control for a bit. Default: 2000
  • colorBatchSize
    Items colored in one batch before allowing browser to take control for a bit. Default: 200
  • transitionSpeed
    Conditional formatting color transition speed in ms (0 = disabled). Default: 0
  • callback
    Allows passing a function that will be called once the coloring is finished. No default value

About

A conditional formatting (color coding) plugin for jQuery

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published