rails_modular_admin 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/list.txt +23 -0
- data/app/assets/javascripts/rails_modular_admin/vendor.js +60351 -60351
- data/app/assets/javascripts/rails_modular_admin.js +1 -0
- data/app/assets/node_modules/animate.css/LICENSE +21 -0
- data/app/assets/node_modules/animate.css/README.md +233 -0
- data/app/assets/node_modules/animate.css/animate-config.json +120 -0
- data/app/assets/node_modules/animate.css/animate.css +3494 -0
- data/app/assets/node_modules/animate.css/animate.min.css +11 -0
- data/app/assets/node_modules/animate.css/bower.json +5 -0
- data/app/assets/node_modules/animate.css/gulpfile.js +107 -0
- data/app/assets/node_modules/animate.css/package.json +54 -0
- data/app/assets/node_modules/animate.css/source/_base.css +8 -0
- data/app/assets/node_modules/animate.css/source/attention_seekers/bounce.css +30 -0
- data/app/assets/node_modules/animate.css/source/attention_seekers/flash.css +16 -0
- data/app/assets/node_modules/animate.css/source/attention_seekers/headShake.css +30 -0
- data/app/assets/node_modules/animate.css/source/attention_seekers/jello.css +40 -0
- data/app/assets/node_modules/animate.css/source/attention_seekers/pulse.css +19 -0
- data/app/assets/node_modules/animate.css/source/attention_seekers/rubberBand.css +33 -0
- data/app/assets/node_modules/animate.css/source/attention_seekers/shake.css +25 -0
- data/app/assets/node_modules/animate.css/source/attention_seekers/swing.css +26 -0
- data/app/assets/node_modules/animate.css/source/attention_seekers/tada.css +31 -0
- data/app/assets/node_modules/animate.css/source/attention_seekers/wobble.css +35 -0
- data/app/assets/node_modules/animate.css/source/bouncing_entrances/bounceIn.css +42 -0
- data/app/assets/node_modules/animate.css/source/bouncing_entrances/bounceInDown.css +35 -0
- data/app/assets/node_modules/animate.css/source/bouncing_entrances/bounceInLeft.css +35 -0
- data/app/assets/node_modules/animate.css/source/bouncing_entrances/bounceInRight.css +35 -0
- data/app/assets/node_modules/animate.css/source/bouncing_entrances/bounceInUp.css +35 -0
- data/app/assets/node_modules/animate.css/source/bouncing_exits/bounceOut.css +21 -0
- data/app/assets/node_modules/animate.css/source/bouncing_exits/bounceOutDown.css +20 -0
- data/app/assets/node_modules/animate.css/source/bouncing_exits/bounceOutLeft.css +15 -0
- data/app/assets/node_modules/animate.css/source/bouncing_exits/bounceOutRight.css +15 -0
- data/app/assets/node_modules/animate.css/source/bouncing_exits/bounceOutUp.css +20 -0
- data/app/assets/node_modules/animate.css/source/fading_entrances/fadeIn.css +13 -0
- data/app/assets/node_modules/animate.css/source/fading_entrances/fadeInDown.css +15 -0
- data/app/assets/node_modules/animate.css/source/fading_entrances/fadeInDownBig.css +15 -0
- data/app/assets/node_modules/animate.css/source/fading_entrances/fadeInLeft.css +15 -0
- data/app/assets/node_modules/animate.css/source/fading_entrances/fadeInLeftBig.css +15 -0
- data/app/assets/node_modules/animate.css/source/fading_entrances/fadeInRight.css +15 -0
- data/app/assets/node_modules/animate.css/source/fading_entrances/fadeInRightBig.css +15 -0
- data/app/assets/node_modules/animate.css/source/fading_entrances/fadeInUp.css +15 -0
- data/app/assets/node_modules/animate.css/source/fading_entrances/fadeInUpBig.css +15 -0
- data/app/assets/node_modules/animate.css/source/fading_exits/fadeOut.css +13 -0
- data/app/assets/node_modules/animate.css/source/fading_exits/fadeOutDown.css +14 -0
- data/app/assets/node_modules/animate.css/source/fading_exits/fadeOutDownBig.css +14 -0
- data/app/assets/node_modules/animate.css/source/fading_exits/fadeOutLeft.css +14 -0
- data/app/assets/node_modules/animate.css/source/fading_exits/fadeOutLeftBig.css +14 -0
- data/app/assets/node_modules/animate.css/source/fading_exits/fadeOutRight.css +14 -0
- data/app/assets/node_modules/animate.css/source/fading_exits/fadeOutRightBig.css +14 -0
- data/app/assets/node_modules/animate.css/source/fading_exits/fadeOutUp.css +14 -0
- data/app/assets/node_modules/animate.css/source/fading_exits/fadeOutUpBig.css +14 -0
- data/app/assets/node_modules/animate.css/source/flippers/flip.css +31 -0
- data/app/assets/node_modules/animate.css/source/flippers/flipInX.css +30 -0
- data/app/assets/node_modules/animate.css/source/flippers/flipInY.css +30 -0
- data/app/assets/node_modules/animate.css/source/flippers/flipOutX.css +21 -0
- data/app/assets/node_modules/animate.css/source/flippers/flipOutY.css +21 -0
- data/app/assets/node_modules/animate.css/source/lightspeed/lightSpeedIn.css +26 -0
- data/app/assets/node_modules/animate.css/source/lightspeed/lightSpeedOut.css +15 -0
- data/app/assets/node_modules/animate.css/source/rotating_entrances/rotateIn.css +17 -0
- data/app/assets/node_modules/animate.css/source/rotating_entrances/rotateInDownLeft.css +17 -0
- data/app/assets/node_modules/animate.css/source/rotating_entrances/rotateInDownRight.css +17 -0
- data/app/assets/node_modules/animate.css/source/rotating_entrances/rotateInUpLeft.css +17 -0
- data/app/assets/node_modules/animate.css/source/rotating_entrances/rotateInUpRight.css +17 -0
- data/app/assets/node_modules/animate.css/source/rotating_exits/rotateOut.css +16 -0
- data/app/assets/node_modules/animate.css/source/rotating_exits/rotateOutDownLeft.css +16 -0
- data/app/assets/node_modules/animate.css/source/rotating_exits/rotateOutDownRight.css +16 -0
- data/app/assets/node_modules/animate.css/source/rotating_exits/rotateOutUpLeft.css +16 -0
- data/app/assets/node_modules/animate.css/source/rotating_exits/rotateOutUpRight.css +16 -0
- data/app/assets/node_modules/animate.css/source/sliding_entrances/slideInDown.css +14 -0
- data/app/assets/node_modules/animate.css/source/sliding_entrances/slideInLeft.css +14 -0
- data/app/assets/node_modules/animate.css/source/sliding_entrances/slideInRight.css +14 -0
- data/app/assets/node_modules/animate.css/source/sliding_entrances/slideInUp.css +14 -0
- data/app/assets/node_modules/animate.css/source/sliding_exits/slideOutDown.css +14 -0
- data/app/assets/node_modules/animate.css/source/sliding_exits/slideOutLeft.css +14 -0
- data/app/assets/node_modules/animate.css/source/sliding_exits/slideOutRight.css +14 -0
- data/app/assets/node_modules/animate.css/source/sliding_exits/slideOutUp.css +14 -0
- data/app/assets/node_modules/animate.css/source/specials/hinge.css +31 -0
- data/app/assets/node_modules/animate.css/source/specials/jackInTheBox.css +24 -0
- data/app/assets/node_modules/animate.css/source/specials/rollIn.css +17 -0
- data/app/assets/node_modules/animate.css/source/specials/rollOut.css +16 -0
- data/app/assets/node_modules/animate.css/source/zooming_entrances/zoomIn.css +14 -0
- data/app/assets/node_modules/animate.css/source/zooming_entrances/zoomInDown.css +17 -0
- data/app/assets/node_modules/animate.css/source/zooming_entrances/zoomInLeft.css +17 -0
- data/app/assets/node_modules/animate.css/source/zooming_entrances/zoomInRight.css +17 -0
- data/app/assets/node_modules/animate.css/source/zooming_entrances/zoomInUp.css +17 -0
- data/app/assets/node_modules/animate.css/source/zooming_exits/zoomOut.css +18 -0
- data/app/assets/node_modules/animate.css/source/zooming_exits/zoomOutDown.css +18 -0
- data/app/assets/node_modules/animate.css/source/zooming_exits/zoomOutLeft.css +16 -0
- data/app/assets/node_modules/animate.css/source/zooming_exits/zoomOutRight.css +16 -0
- data/app/assets/node_modules/animate.css/source/zooming_exits/zoomOutUp.css +18 -0
- data/app/assets/node_modules/bootstrap/LICENSE +22 -0
- data/app/assets/node_modules/bootstrap/README.md +171 -0
- data/app/assets/node_modules/bootstrap/dist/css/bootstrap-grid.css +1912 -0
- data/app/assets/node_modules/bootstrap/dist/css/bootstrap-grid.css.map +1 -0
- data/app/assets/node_modules/bootstrap/dist/css/bootstrap-grid.min.css +7 -0
- data/app/assets/node_modules/bootstrap/dist/css/bootstrap-grid.min.css.map +1 -0
- data/app/assets/node_modules/bootstrap/dist/css/bootstrap-reboot.css +330 -0
- data/app/assets/node_modules/bootstrap/dist/css/bootstrap-reboot.css.map +1 -0
- data/app/assets/node_modules/bootstrap/dist/css/bootstrap-reboot.min.css +8 -0
- data/app/assets/node_modules/bootstrap/dist/css/bootstrap-reboot.min.css.map +1 -0
- data/app/assets/node_modules/bootstrap/dist/css/bootstrap.css +8981 -0
- data/app/assets/node_modules/bootstrap/dist/css/bootstrap.css.map +1 -0
- data/app/assets/node_modules/bootstrap/dist/css/bootstrap.min.css +7 -0
- data/app/assets/node_modules/bootstrap/dist/css/bootstrap.min.css.map +1 -0
- data/app/assets/node_modules/bootstrap/dist/js/bootstrap.bundle.js +6444 -0
- data/app/assets/node_modules/bootstrap/dist/js/bootstrap.bundle.js.map +1 -0
- data/app/assets/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js +7 -0
- data/app/assets/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js.map +1 -0
- data/app/assets/node_modules/bootstrap/dist/js/bootstrap.js +3927 -0
- data/app/assets/node_modules/bootstrap/dist/js/bootstrap.js.map +1 -0
- data/app/assets/node_modules/bootstrap/dist/js/bootstrap.min.js +7 -0
- data/app/assets/node_modules/bootstrap/dist/js/bootstrap.min.js.map +1 -0
- data/app/assets/node_modules/bootstrap/js/dist/alert.js +178 -0
- data/app/assets/node_modules/bootstrap/js/dist/alert.js.map +1 -0
- data/app/assets/node_modules/bootstrap/js/dist/button.js +167 -0
- data/app/assets/node_modules/bootstrap/js/dist/button.js.map +1 -0
- data/app/assets/node_modules/bootstrap/js/dist/carousel.js +508 -0
- data/app/assets/node_modules/bootstrap/js/dist/carousel.js.map +1 -0
- data/app/assets/node_modules/bootstrap/js/dist/collapse.js +367 -0
- data/app/assets/node_modules/bootstrap/js/dist/collapse.js.map +1 -0
- data/app/assets/node_modules/bootstrap/js/dist/dropdown.js +489 -0
- data/app/assets/node_modules/bootstrap/js/dist/dropdown.js.map +1 -0
- data/app/assets/node_modules/bootstrap/js/dist/index.js +23 -0
- data/app/assets/node_modules/bootstrap/js/dist/index.js.map +1 -0
- data/app/assets/node_modules/bootstrap/js/dist/modal.js +585 -0
- data/app/assets/node_modules/bootstrap/js/dist/modal.js.map +1 -0
- data/app/assets/node_modules/bootstrap/js/dist/popover.js +206 -0
- data/app/assets/node_modules/bootstrap/js/dist/popover.js.map +1 -0
- data/app/assets/node_modules/bootstrap/js/dist/scrollspy.js +319 -0
- data/app/assets/node_modules/bootstrap/js/dist/scrollspy.js.map +1 -0
- data/app/assets/node_modules/bootstrap/js/dist/tab.js +251 -0
- data/app/assets/node_modules/bootstrap/js/dist/tab.js.map +1 -0
- data/app/assets/node_modules/bootstrap/js/dist/tooltip.js +674 -0
- data/app/assets/node_modules/bootstrap/js/dist/tooltip.js.map +1 -0
- data/app/assets/node_modules/bootstrap/js/dist/util.js +132 -0
- data/app/assets/node_modules/bootstrap/js/dist/util.js.map +1 -0
- data/app/assets/node_modules/bootstrap/js/src/alert.js +183 -0
- data/app/assets/node_modules/bootstrap/js/src/button.js +175 -0
- data/app/assets/node_modules/bootstrap/js/src/carousel.js +517 -0
- data/app/assets/node_modules/bootstrap/js/src/collapse.js +394 -0
- data/app/assets/node_modules/bootstrap/js/src/dropdown.js +487 -0
- data/app/assets/node_modules/bootstrap/js/src/index.js +50 -0
- data/app/assets/node_modules/bootstrap/js/src/modal.js +579 -0
- data/app/assets/node_modules/bootstrap/js/src/popover.js +188 -0
- data/app/assets/node_modules/bootstrap/js/src/scrollspy.js +329 -0
- data/app/assets/node_modules/bootstrap/js/src/tab.js +263 -0
- data/app/assets/node_modules/bootstrap/js/src/tooltip.js +723 -0
- data/app/assets/node_modules/bootstrap/js/src/util.js +153 -0
- data/app/assets/node_modules/bootstrap/package.json +218 -0
- data/app/assets/node_modules/bootstrap/scss/_alert.scss +51 -0
- data/app/assets/node_modules/bootstrap/scss/_badge.scss +47 -0
- data/app/assets/node_modules/bootstrap/scss/_breadcrumb.scss +41 -0
- data/app/assets/node_modules/bootstrap/scss/_button-group.scss +172 -0
- data/app/assets/node_modules/bootstrap/scss/_buttons.scss +144 -0
- data/app/assets/node_modules/bootstrap/scss/_card.scss +301 -0
- data/app/assets/node_modules/bootstrap/scss/_carousel.scss +236 -0
- data/app/assets/node_modules/bootstrap/scss/_close.scss +34 -0
- data/app/assets/node_modules/bootstrap/scss/_code.scss +48 -0
- data/app/assets/node_modules/bootstrap/scss/_custom-forms.scss +421 -0
- data/app/assets/node_modules/bootstrap/scss/_dropdown.scss +166 -0
- data/app/assets/node_modules/bootstrap/scss/_forms.scss +335 -0
- data/app/assets/node_modules/bootstrap/scss/_functions.scss +86 -0
- data/app/assets/node_modules/bootstrap/scss/_grid.scss +52 -0
- data/app/assets/node_modules/bootstrap/scss/_images.scss +42 -0
- data/app/assets/node_modules/bootstrap/scss/_input-group.scss +158 -0
- data/app/assets/node_modules/bootstrap/scss/_jumbotron.scss +16 -0
- data/app/assets/node_modules/bootstrap/scss/_list-group.scss +115 -0
- data/app/assets/node_modules/bootstrap/scss/_media.scss +8 -0
- data/app/assets/node_modules/bootstrap/scss/_mixins.scss +41 -0
- data/app/assets/node_modules/bootstrap/scss/_modal.scss +168 -0
- data/app/assets/node_modules/bootstrap/scss/_nav.scss +118 -0
- data/app/assets/node_modules/bootstrap/scss/_navbar.scss +299 -0
- data/app/assets/node_modules/bootstrap/scss/_pagination.scss +78 -0
- data/app/assets/node_modules/bootstrap/scss/_popover.scss +183 -0
- data/app/assets/node_modules/bootstrap/scss/_print.scss +141 -0
- data/app/assets/node_modules/bootstrap/scss/_progress.scss +34 -0
- data/app/assets/node_modules/bootstrap/scss/_reboot.scss +480 -0
- data/app/assets/node_modules/bootstrap/scss/_root.scss +19 -0
- data/app/assets/node_modules/bootstrap/scss/_tables.scss +188 -0
- data/app/assets/node_modules/bootstrap/scss/_tooltip.scss +115 -0
- data/app/assets/node_modules/bootstrap/scss/_transitions.scss +22 -0
- data/app/assets/node_modules/bootstrap/scss/_type.scss +125 -0
- data/app/assets/node_modules/bootstrap/scss/_utilities.scss +15 -0
- data/app/assets/node_modules/bootstrap/scss/_variables.scss +929 -0
- data/app/assets/node_modules/bootstrap/scss/bootstrap-grid.scss +32 -0
- data/app/assets/node_modules/bootstrap/scss/bootstrap-reboot.scss +12 -0
- data/app/assets/node_modules/bootstrap/scss/bootstrap.scss +42 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_alert.scss +13 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_background-variant.scss +21 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_badge.scss +12 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_border-radius.scss +35 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_box-shadow.scss +5 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_breakpoints.scss +123 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_buttons.scss +109 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_caret.scss +66 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_clearfix.scss +7 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_float.scss +11 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_forms.scss +147 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_gradients.scss +45 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_grid-framework.scss +67 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_grid.scss +52 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_hover.scss +37 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_image.scss +36 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_list-group.scss +21 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_lists.scss +7 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_nav-divider.scss +10 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_pagination.scss +22 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_reset-text.scss +17 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_resize.scss +6 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_screen-reader.scss +33 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_size.scss +6 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_table-row.scss +30 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_text-emphasis.scss +14 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_text-hide.scss +13 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_text-truncate.scss +8 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_transition.scss +13 -0
- data/app/assets/node_modules/bootstrap/scss/mixins/_visibility.scss +7 -0
- data/app/assets/node_modules/bootstrap/scss/utilities/_align.scss +8 -0
- data/app/assets/node_modules/bootstrap/scss/utilities/_background.scss +19 -0
- data/app/assets/node_modules/bootstrap/scss/utilities/_borders.scss +59 -0
- data/app/assets/node_modules/bootstrap/scss/utilities/_clearfix.scss +3 -0
- data/app/assets/node_modules/bootstrap/scss/utilities/_display.scss +38 -0
- data/app/assets/node_modules/bootstrap/scss/utilities/_embed.scss +52 -0
- data/app/assets/node_modules/bootstrap/scss/utilities/_flex.scss +51 -0
- data/app/assets/node_modules/bootstrap/scss/utilities/_float.scss +9 -0
- data/app/assets/node_modules/bootstrap/scss/utilities/_position.scss +37 -0
- data/app/assets/node_modules/bootstrap/scss/utilities/_screenreaders.scss +11 -0
- data/app/assets/node_modules/bootstrap/scss/utilities/_shadows.scss +6 -0
- data/app/assets/node_modules/bootstrap/scss/utilities/_sizing.scss +12 -0
- data/app/assets/node_modules/bootstrap/scss/utilities/_spacing.scss +51 -0
- data/app/assets/node_modules/bootstrap/scss/utilities/_text.scss +58 -0
- data/app/assets/node_modules/bootstrap/scss/utilities/_visibility.scss +11 -0
- data/app/assets/node_modules/clone/LICENSE +18 -0
- data/app/assets/node_modules/clone/README.md +178 -0
- data/app/assets/node_modules/clone/clone.iml +10 -0
- data/app/assets/node_modules/clone/clone.js +251 -0
- data/app/assets/node_modules/clone/package.json +56 -0
- data/app/assets/node_modules/deep-equal/LICENSE +18 -0
- data/app/assets/node_modules/deep-equal/example/cmp.js +11 -0
- data/app/assets/node_modules/deep-equal/index.js +94 -0
- data/app/assets/node_modules/deep-equal/lib/is_arguments.js +20 -0
- data/app/assets/node_modules/deep-equal/lib/keys.js +9 -0
- data/app/assets/node_modules/deep-equal/package.json +58 -0
- data/app/assets/node_modules/deep-equal/readme.markdown +61 -0
- data/app/assets/node_modules/deep-equal/test/cmp.js +95 -0
- data/app/assets/node_modules/dropzone/CONTRIBUTING.md +6 -0
- data/app/assets/node_modules/dropzone/LICENSE +12 -0
- data/app/assets/node_modules/dropzone/README.md +36 -0
- data/app/assets/node_modules/dropzone/bower.json +16 -0
- data/app/assets/node_modules/dropzone/component.json +10 -0
- data/app/assets/node_modules/dropzone/composer.json +18 -0
- data/app/assets/node_modules/dropzone/dist/basic.css +39 -0
- data/app/assets/node_modules/dropzone/dist/dropzone-amd-module.js +3541 -0
- data/app/assets/node_modules/dropzone/dist/dropzone.css +388 -0
- data/app/assets/node_modules/dropzone/dist/dropzone.js +3526 -0
- data/app/assets/node_modules/dropzone/dist/min/basic.min.css +1 -0
- data/app/assets/node_modules/dropzone/dist/min/dropzone-amd-module.min.js +2 -0
- data/app/assets/node_modules/dropzone/dist/min/dropzone.min.css +1 -0
- data/app/assets/node_modules/dropzone/dist/min/dropzone.min.js +2 -0
- data/app/assets/node_modules/dropzone/dist/readme.md +10 -0
- data/app/assets/node_modules/dropzone/index.js +1 -0
- data/app/assets/node_modules/dropzone/package.json +40 -0
- data/app/assets/node_modules/eve-raphael/LICENSE +202 -0
- data/app/assets/node_modules/eve-raphael/README.md +5 -0
- data/app/assets/node_modules/eve-raphael/bower.json +17 -0
- data/app/assets/node_modules/eve-raphael/component.json +13 -0
- data/app/assets/node_modules/eve-raphael/e.html +66 -0
- data/app/assets/node_modules/eve-raphael/eve.js +426 -0
- data/app/assets/node_modules/eve-raphael/package.json +15 -0
- data/app/assets/node_modules/eventemitter3/LICENSE +21 -0
- data/app/assets/node_modules/eventemitter3/README.md +105 -0
- data/app/assets/node_modules/eventemitter3/index.d.ts +50 -0
- data/app/assets/node_modules/eventemitter3/index.js +311 -0
- data/app/assets/node_modules/eventemitter3/package.json +51 -0
- data/app/assets/node_modules/eventemitter3/umd/eventemitter3.min.js +1 -0
- data/app/assets/node_modules/extend/CHANGELOG.md +77 -0
- data/app/assets/node_modules/extend/LICENSE +23 -0
- data/app/assets/node_modules/extend/README.md +81 -0
- data/app/assets/node_modules/extend/component.json +32 -0
- data/app/assets/node_modules/extend/index.js +86 -0
- data/app/assets/node_modules/extend/package.json +43 -0
- data/app/assets/node_modules/fast-diff/README.md +24 -0
- data/app/assets/node_modules/fast-diff/diff.js +738 -0
- data/app/assets/node_modules/fast-diff/package.json +24 -0
- data/app/assets/node_modules/fast-diff/test.js +91 -0
- data/app/assets/node_modules/jquery/AUTHORS.txt +313 -0
- data/app/assets/node_modules/jquery/LICENSE.txt +36 -0
- data/app/assets/node_modules/jquery/README.md +67 -0
- data/app/assets/node_modules/jquery/bower.json +14 -0
- data/app/assets/node_modules/jquery/dist/core.js +399 -0
- data/app/assets/node_modules/jquery/dist/jquery.js +10364 -0
- data/app/assets/node_modules/jquery/dist/jquery.min.js +2 -0
- data/app/assets/node_modules/jquery/dist/jquery.min.map +1 -0
- data/app/assets/node_modules/jquery/dist/jquery.slim.js +8269 -0
- data/app/assets/node_modules/jquery/dist/jquery.slim.min.js +2 -0
- data/app/assets/node_modules/jquery/dist/jquery.slim.min.map +1 -0
- data/app/assets/node_modules/jquery/external/sizzle/LICENSE.txt +36 -0
- data/app/assets/node_modules/jquery/external/sizzle/dist/sizzle.js +2272 -0
- data/app/assets/node_modules/jquery/external/sizzle/dist/sizzle.min.js +3 -0
- data/app/assets/node_modules/jquery/external/sizzle/dist/sizzle.min.map +1 -0
- data/app/assets/node_modules/jquery/package.json +108 -0
- data/app/assets/node_modules/jquery/src/ajax/jsonp.js +103 -0
- data/app/assets/node_modules/jquery/src/ajax/load.js +77 -0
- data/app/assets/node_modules/jquery/src/ajax/parseXML.js +30 -0
- data/app/assets/node_modules/jquery/src/ajax/script.js +77 -0
- data/app/assets/node_modules/jquery/src/ajax/var/location.js +5 -0
- data/app/assets/node_modules/jquery/src/ajax/var/nonce.js +5 -0
- data/app/assets/node_modules/jquery/src/ajax/var/rquery.js +5 -0
- data/app/assets/node_modules/jquery/src/ajax/xhr.js +170 -0
- data/app/assets/node_modules/jquery/src/ajax.js +856 -0
- data/app/assets/node_modules/jquery/src/attributes/attr.js +141 -0
- data/app/assets/node_modules/jquery/src/attributes/classes.js +186 -0
- data/app/assets/node_modules/jquery/src/attributes/prop.js +143 -0
- data/app/assets/node_modules/jquery/src/attributes/support.js +33 -0
- data/app/assets/node_modules/jquery/src/attributes/val.js +191 -0
- data/app/assets/node_modules/jquery/src/attributes.js +13 -0
- data/app/assets/node_modules/jquery/src/callbacks.js +236 -0
- data/app/assets/node_modules/jquery/src/core/DOMEval.js +30 -0
- data/app/assets/node_modules/jquery/src/core/access.js +72 -0
- data/app/assets/node_modules/jquery/src/core/camelCase.js +23 -0
- data/app/assets/node_modules/jquery/src/core/init.js +129 -0
- data/app/assets/node_modules/jquery/src/core/nodeName.js +13 -0
- data/app/assets/node_modules/jquery/src/core/parseHTML.js +65 -0
- data/app/assets/node_modules/jquery/src/core/ready-no-deferred.js +97 -0
- data/app/assets/node_modules/jquery/src/core/ready.js +86 -0
- data/app/assets/node_modules/jquery/src/core/readyException.js +13 -0
- data/app/assets/node_modules/jquery/src/core/stripAndCollapse.js +14 -0
- data/app/assets/node_modules/jquery/src/core/support.js +20 -0
- data/app/assets/node_modules/jquery/src/core/toType.js +20 -0
- data/app/assets/node_modules/jquery/src/core/var/rsingleTag.js +6 -0
- data/app/assets/node_modules/jquery/src/core.js +399 -0
- data/app/assets/node_modules/jquery/src/css/addGetHookIf.js +26 -0
- data/app/assets/node_modules/jquery/src/css/adjustCSS.js +73 -0
- data/app/assets/node_modules/jquery/src/css/curCSS.js +65 -0
- data/app/assets/node_modules/jquery/src/css/hiddenVisibleSelectors.js +15 -0
- data/app/assets/node_modules/jquery/src/css/showHide.js +105 -0
- data/app/assets/node_modules/jquery/src/css/support.js +102 -0
- data/app/assets/node_modules/jquery/src/css/var/cssExpand.js +5 -0
- data/app/assets/node_modules/jquery/src/css/var/getStyles.js +17 -0
- data/app/assets/node_modules/jquery/src/css/var/isHiddenWithinTree.js +34 -0
- data/app/assets/node_modules/jquery/src/css/var/rboxStyle.js +7 -0
- data/app/assets/node_modules/jquery/src/css/var/rnumnonpx.js +7 -0
- data/app/assets/node_modules/jquery/src/css/var/swap.js +26 -0
- data/app/assets/node_modules/jquery/src/css.js +481 -0
- data/app/assets/node_modules/jquery/src/data/Data.js +162 -0
- data/app/assets/node_modules/jquery/src/data/var/acceptData.js +19 -0
- data/app/assets/node_modules/jquery/src/data/var/dataPriv.js +7 -0
- data/app/assets/node_modules/jquery/src/data/var/dataUser.js +7 -0
- data/app/assets/node_modules/jquery/src/data.js +180 -0
- data/app/assets/node_modules/jquery/src/deferred/exceptionHook.js +21 -0
- data/app/assets/node_modules/jquery/src/deferred.js +399 -0
- data/app/assets/node_modules/jquery/src/deprecated.js +98 -0
- data/app/assets/node_modules/jquery/src/dimensions.js +57 -0
- data/app/assets/node_modules/jquery/src/effects/Tween.js +123 -0
- data/app/assets/node_modules/jquery/src/effects/animatedSelector.js +15 -0
- data/app/assets/node_modules/jquery/src/effects.js +702 -0
- data/app/assets/node_modules/jquery/src/event/ajax.js +22 -0
- data/app/assets/node_modules/jquery/src/event/alias.js +29 -0
- data/app/assets/node_modules/jquery/src/event/focusin.js +55 -0
- data/app/assets/node_modules/jquery/src/event/support.js +11 -0
- data/app/assets/node_modules/jquery/src/event/trigger.js +199 -0
- data/app/assets/node_modules/jquery/src/event.js +748 -0
- data/app/assets/node_modules/jquery/src/exports/amd.js +26 -0
- data/app/assets/node_modules/jquery/src/exports/global.js +34 -0
- data/app/assets/node_modules/jquery/src/jquery.js +40 -0
- data/app/assets/node_modules/jquery/src/manipulation/_evalUrl.js +23 -0
- data/app/assets/node_modules/jquery/src/manipulation/buildFragment.js +105 -0
- data/app/assets/node_modules/jquery/src/manipulation/getAll.js +32 -0
- data/app/assets/node_modules/jquery/src/manipulation/setGlobalEval.js +22 -0
- data/app/assets/node_modules/jquery/src/manipulation/support.js +35 -0
- data/app/assets/node_modules/jquery/src/manipulation/var/rcheckableType.js +5 -0
- data/app/assets/node_modules/jquery/src/manipulation/var/rscriptType.js +5 -0
- data/app/assets/node_modules/jquery/src/manipulation/var/rtagName.js +5 -0
- data/app/assets/node_modules/jquery/src/manipulation/wrapMap.js +29 -0
- data/app/assets/node_modules/jquery/src/manipulation.js +486 -0
- data/app/assets/node_modules/jquery/src/offset.js +233 -0
- data/app/assets/node_modules/jquery/src/queue/delay.js +24 -0
- data/app/assets/node_modules/jquery/src/queue.js +145 -0
- data/app/assets/node_modules/jquery/src/selector-native.js +237 -0
- data/app/assets/node_modules/jquery/src/selector-sizzle.js +19 -0
- data/app/assets/node_modules/jquery/src/selector.js +3 -0
- data/app/assets/node_modules/jquery/src/serialize.js +132 -0
- data/app/assets/node_modules/jquery/src/traversing/findFilter.js +97 -0
- data/app/assets/node_modules/jquery/src/traversing/var/dir.js +22 -0
- data/app/assets/node_modules/jquery/src/traversing/var/rneedsContext.js +8 -0
- data/app/assets/node_modules/jquery/src/traversing/var/siblings.js +17 -0
- data/app/assets/node_modules/jquery/src/traversing.js +191 -0
- data/app/assets/node_modules/jquery/src/var/ObjectFunctionString.js +7 -0
- data/app/assets/node_modules/jquery/src/var/arr.js +5 -0
- data/app/assets/node_modules/jquery/src/var/class2type.js +6 -0
- data/app/assets/node_modules/jquery/src/var/concat.js +7 -0
- data/app/assets/node_modules/jquery/src/var/document.js +5 -0
- data/app/assets/node_modules/jquery/src/var/documentElement.js +7 -0
- data/app/assets/node_modules/jquery/src/var/fnToString.js +7 -0
- data/app/assets/node_modules/jquery/src/var/getProto.js +5 -0
- data/app/assets/node_modules/jquery/src/var/hasOwn.js +7 -0
- data/app/assets/node_modules/jquery/src/var/indexOf.js +7 -0
- data/app/assets/node_modules/jquery/src/var/isFunction.js +13 -0
- data/app/assets/node_modules/jquery/src/var/isWindow.js +8 -0
- data/app/assets/node_modules/jquery/src/var/pnum.js +5 -0
- data/app/assets/node_modules/jquery/src/var/push.js +7 -0
- data/app/assets/node_modules/jquery/src/var/rcssNum.js +9 -0
- data/app/assets/node_modules/jquery/src/var/rnothtmlwhite.js +8 -0
- data/app/assets/node_modules/jquery/src/var/slice.js +7 -0
- data/app/assets/node_modules/jquery/src/var/support.js +6 -0
- data/app/assets/node_modules/jquery/src/var/toString.js +7 -0
- data/app/assets/node_modules/jquery/src/wrap.js +78 -0
- data/app/assets/node_modules/jquery-flot/API.md +1498 -0
- data/app/assets/node_modules/jquery-flot/CONTRIBUTING.md +98 -0
- data/app/assets/node_modules/jquery-flot/FAQ.md +75 -0
- data/app/assets/node_modules/jquery-flot/LICENSE.txt +22 -0
- data/app/assets/node_modules/jquery-flot/Makefile +12 -0
- data/app/assets/node_modules/jquery-flot/NEWS.md +1026 -0
- data/app/assets/node_modules/jquery-flot/PLUGINS.md +143 -0
- data/app/assets/node_modules/jquery-flot/README.md +110 -0
- data/app/assets/node_modules/jquery-flot/component.json +8 -0
- data/app/assets/node_modules/jquery-flot/examples/ajax/data-eu-gdp-growth-1.json +4 -0
- data/app/assets/node_modules/jquery-flot/examples/ajax/data-eu-gdp-growth-2.json +4 -0
- data/app/assets/node_modules/jquery-flot/examples/ajax/data-eu-gdp-growth-3.json +4 -0
- data/app/assets/node_modules/jquery-flot/examples/ajax/data-eu-gdp-growth-4.json +4 -0
- data/app/assets/node_modules/jquery-flot/examples/ajax/data-eu-gdp-growth-5.json +4 -0
- data/app/assets/node_modules/jquery-flot/examples/ajax/data-eu-gdp-growth.json +4 -0
- data/app/assets/node_modules/jquery-flot/examples/ajax/data-japan-gdp-growth.json +4 -0
- data/app/assets/node_modules/jquery-flot/examples/ajax/data-usa-gdp-growth.json +4 -0
- data/app/assets/node_modules/jquery-flot/examples/ajax/index.html +173 -0
- data/app/assets/node_modules/jquery-flot/examples/annotating/index.html +87 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-interacting/index.html +97 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-multiple/index.html +77 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time/index.html +137 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/date.js +893 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/index.html +114 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/africa +1181 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/antarctica +413 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/asia +2717 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/australasia +1719 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/backward +117 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/etcetera +81 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/europe +2856 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/factory +10 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/iso3166.tab +276 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/leapseconds +100 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/northamerica +3235 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/pacificnew +28 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/solar87 +390 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/solar88 +390 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/solar89 +395 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/southamerica +1711 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/systemv +38 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/yearistype.sh +38 -0
- data/app/assets/node_modules/jquery-flot/examples/axes-time-zones/tz/zone.tab +441 -0
- data/app/assets/node_modules/jquery-flot/examples/background.png +0 -0
- data/app/assets/node_modules/jquery-flot/examples/basic-options/index.html +91 -0
- data/app/assets/node_modules/jquery-flot/examples/basic-usage/index.html +57 -0
- data/app/assets/node_modules/jquery-flot/examples/canvas/index.html +75 -0
- data/app/assets/node_modules/jquery-flot/examples/categories/index.html +64 -0
- data/app/assets/node_modules/jquery-flot/examples/examples.css +97 -0
- data/app/assets/node_modules/jquery-flot/examples/image/hs-2004-27-a-large-web.jpg +0 -0
- data/app/assets/node_modules/jquery-flot/examples/image/index.html +69 -0
- data/app/assets/node_modules/jquery-flot/examples/index.html +80 -0
- data/app/assets/node_modules/jquery-flot/examples/interacting/index.html +118 -0
- data/app/assets/node_modules/jquery-flot/examples/navigate/arrow-down.gif +0 -0
- data/app/assets/node_modules/jquery-flot/examples/navigate/arrow-left.gif +0 -0
- data/app/assets/node_modules/jquery-flot/examples/navigate/arrow-right.gif +0 -0
- data/app/assets/node_modules/jquery-flot/examples/navigate/arrow-up.gif +0 -0
- data/app/assets/node_modules/jquery-flot/examples/navigate/index.html +153 -0
- data/app/assets/node_modules/jquery-flot/examples/percentiles/index.html +79 -0
- data/app/assets/node_modules/jquery-flot/examples/realtime/index.html +122 -0
- data/app/assets/node_modules/jquery-flot/examples/resize/index.html +76 -0
- data/app/assets/node_modules/jquery-flot/examples/selection/index.html +152 -0
- data/app/assets/node_modules/jquery-flot/examples/series-errorbars/index.html +150 -0
- data/app/assets/node_modules/jquery-flot/examples/series-pie/index.html +818 -0
- data/app/assets/node_modules/jquery-flot/examples/series-toggle/index.html +121 -0
- data/app/assets/node_modules/jquery-flot/examples/series-types/index.html +90 -0
- data/app/assets/node_modules/jquery-flot/examples/shared/jquery-ui/jquery-ui.min.css +6 -0
- data/app/assets/node_modules/jquery-flot/examples/stacking/index.html +107 -0
- data/app/assets/node_modules/jquery-flot/examples/symbols/index.html +76 -0
- data/app/assets/node_modules/jquery-flot/examples/threshold/index.html +76 -0
- data/app/assets/node_modules/jquery-flot/examples/tracking/index.html +135 -0
- data/app/assets/node_modules/jquery-flot/examples/visitors/index.html +147 -0
- data/app/assets/node_modules/jquery-flot/examples/zooming/index.html +144 -0
- data/app/assets/node_modules/jquery-flot/excanvas.js +1428 -0
- data/app/assets/node_modules/jquery-flot/excanvas.min.js +1 -0
- data/app/assets/node_modules/jquery-flot/flot.jquery.json +27 -0
- data/app/assets/node_modules/jquery-flot/jquery.colorhelpers.js +180 -0
- data/app/assets/node_modules/jquery-flot/jquery.flot.canvas.js +345 -0
- data/app/assets/node_modules/jquery-flot/jquery.flot.categories.js +190 -0
- data/app/assets/node_modules/jquery-flot/jquery.flot.crosshair.js +176 -0
- data/app/assets/node_modules/jquery-flot/jquery.flot.errorbars.js +353 -0
- data/app/assets/node_modules/jquery-flot/jquery.flot.fillbetween.js +226 -0
- data/app/assets/node_modules/jquery-flot/jquery.flot.image.js +241 -0
- data/app/assets/node_modules/jquery-flot/jquery.flot.js +3168 -0
- data/app/assets/node_modules/jquery-flot/jquery.flot.navigate.js +346 -0
- data/app/assets/node_modules/jquery-flot/jquery.flot.pie.js +820 -0
- data/app/assets/node_modules/jquery-flot/jquery.flot.resize.js +59 -0
- data/app/assets/node_modules/jquery-flot/jquery.flot.selection.js +360 -0
- data/app/assets/node_modules/jquery-flot/jquery.flot.stack.js +188 -0
- data/app/assets/node_modules/jquery-flot/jquery.flot.symbol.js +71 -0
- data/app/assets/node_modules/jquery-flot/jquery.flot.threshold.js +142 -0
- data/app/assets/node_modules/jquery-flot/jquery.flot.time.js +432 -0
- data/app/assets/node_modules/jquery-flot/jquery.js +9472 -0
- data/app/assets/node_modules/jquery-flot/package.json +11 -0
- data/app/assets/node_modules/jquery-sparkline/Changelog.txt +324 -0
- data/app/assets/node_modules/jquery-sparkline/README.md +19 -0
- data/app/assets/node_modules/jquery-sparkline/build.js +13 -0
- data/app/assets/node_modules/jquery-sparkline/jquery.sparkline.js +3068 -0
- data/app/assets/node_modules/jquery-sparkline/jquery.sparkline.min.js +2 -0
- data/app/assets/node_modules/jquery-sparkline/package.json +32 -0
- data/app/assets/node_modules/jquery-sparkline/src/base.js +415 -0
- data/app/assets/node_modules/jquery-sparkline/src/chart-bar.js +256 -0
- data/app/assets/node_modules/jquery-sparkline/src/chart-box.js +186 -0
- data/app/assets/node_modules/jquery-sparkline/src/chart-bullet.js +131 -0
- data/app/assets/node_modules/jquery-sparkline/src/chart-discrete.js +66 -0
- data/app/assets/node_modules/jquery-sparkline/src/chart-line.js +350 -0
- data/app/assets/node_modules/jquery-sparkline/src/chart-pie.js +117 -0
- data/app/assets/node_modules/jquery-sparkline/src/chart-tristate.js +98 -0
- data/app/assets/node_modules/jquery-sparkline/src/defaults.js +156 -0
- data/app/assets/node_modules/jquery-sparkline/src/footer.js +1 -0
- data/app/assets/node_modules/jquery-sparkline/src/header.js +222 -0
- data/app/assets/node_modules/jquery-sparkline/src/interact.js +247 -0
- data/app/assets/node_modules/jquery-sparkline/src/rangemap.js +39 -0
- data/app/assets/node_modules/jquery-sparkline/src/simpledraw.js +55 -0
- data/app/assets/node_modules/jquery-sparkline/src/utils.js +224 -0
- data/app/assets/node_modules/jquery-sparkline/src/vcanvas-base.js +147 -0
- data/app/assets/node_modules/jquery-sparkline/src/vcanvas-canvas.js +193 -0
- data/app/assets/node_modules/jquery-sparkline/src/vcanvas-vml.js +165 -0
- data/app/assets/node_modules/jquery-touchswipe/LICENSE +24 -0
- data/app/assets/node_modules/jquery-touchswipe/README.md +81 -0
- data/app/assets/node_modules/jquery-touchswipe/bower.json +8 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Any_finger_swipe.html +49 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Basic_swipe.html +48 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Enable_and_destroy.html +95 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Excluded_children.html +82 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Finger_swipe.html +61 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Handlers_and_events.html +128 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Hold.html +61 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Image_gallery_example.html +148 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Options.html +90 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Page_scrolling.html +109 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Page_zoom.html +50 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Pinch.html +57 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Pinch_and_Swipe.html +81 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Pinch_status.html +51 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Single_swipe.html +51 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Stop_propegation.html +57 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Swipe_status.html +82 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Tap_vs_swipe.html +114 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Thresholds.html +109 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/Trigger_handlers.html +158 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/css/main.css +110 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/index.html +74 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/js/jquery.ui.ipad.js +223 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/js/main.js +240 -0
- data/app/assets/node_modules/jquery-touchswipe/demos/tutorials.json +22 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/$.fn.html +188 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/$.fn.swipe.defaults.html +1174 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/$.fn.swipe.directions.html +311 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/$.fn.swipe.fingers.html +319 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/$.fn.swipe.html +4205 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/$.fn.swipe.pageScroll.html +272 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/$.fn.swipe.phases.html +265 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/$.html +186 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/css/main.css +110 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/index.html +101 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/jquery.touchSwipe.js.html +2168 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/js/jquery.ui.ipad.js +223 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/js/main.js +85 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/scripts/linenumber.js +25 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/scripts/prettify/lang-css.js +2 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/scripts/prettify/prettify.js +28 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/styles/jsdoc.css +625 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/styles/prettify.css +79 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Any_finger_swipe.html +108 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Basic_swipe.html +107 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Enable_and_destroy.html +154 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Excluded_children.html +141 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Finger_swipe.html +120 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Handlers_and_events.html +187 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Hold.html +120 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Image_gallery_example.html +207 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Options.html +149 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Page_scrolling.html +168 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Page_zoom.html +109 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Pinch.html +116 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Pinch_and_Swipe.html +140 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Pinch_status.html +110 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Single_swipe.html +110 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Stop_propegation.html +116 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Swipe_status.html +141 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Tap_vs_swipe.html +173 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Thresholds.html +168 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-Trigger_handlers.html +217 -0
- data/app/assets/node_modules/jquery-touchswipe/docs/tutorial-index_.html +133 -0
- data/app/assets/node_modules/jquery-touchswipe/jquery.touchSwipe.js +2109 -0
- data/app/assets/node_modules/jquery-touchswipe/jquery.touchSwipe.min.js +14 -0
- data/app/assets/node_modules/jquery-touchswipe/package.json +47 -0
- data/app/assets/node_modules/jquery-validation/LICENSE.md +22 -0
- data/app/assets/node_modules/jquery-validation/README.md +76 -0
- data/app/assets/node_modules/jquery-validation/changelog.md +639 -0
- data/app/assets/node_modules/jquery-validation/dist/additional-methods.js +1158 -0
- data/app/assets/node_modules/jquery-validation/dist/jquery.validate.js +1601 -0
- data/app/assets/node_modules/jquery-validation/dist/jquery.validate.min.js +4 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_ar.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_az.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_bg.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_bn_BD.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_ca.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_cs.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_da.js +32 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_de.js +32 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_el.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_es.js +38 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_es_AR.js +39 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_es_PE.js +39 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_et.js +33 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_eu.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_fa.js +38 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_fi.js +33 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_fr.js +63 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_ge.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_gl.js +40 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_he.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_hr.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_hu.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_hy_AM.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_id.js +34 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_is.js +33 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_it.js +39 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_ja.js +36 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_ka.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_kk.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_ko.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_lt.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_lv.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_mk.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_my.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_nl.js +46 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_no.js +36 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_pl.js +37 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_pt_BR.js +88 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_pt_PT.js +39 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_ro.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_ru.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_sd.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_si.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_sk.js +32 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_sl.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_sr.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_sr_lat.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_sv.js +33 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_th.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_tj.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_tr.js +36 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_uk.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_ur.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_vi.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_zh.js +35 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/messages_zh_TW.js +36 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/methods_de.js +24 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/methods_es_CL.js +24 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/methods_fi.js +24 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/methods_nl.js +24 -0
- data/app/assets/node_modules/jquery-validation/dist/localization/methods_pt.js +21 -0
- data/app/assets/node_modules/jquery-validation/package.json +61 -0
- data/app/assets/node_modules/jquery.browser/Gruntfile.js +62 -0
- data/app/assets/node_modules/jquery.browser/MIT-LICENSE.txt +21 -0
- data/app/assets/node_modules/jquery.browser/README.md +117 -0
- data/app/assets/node_modules/jquery.browser/bower.json +13 -0
- data/app/assets/node_modules/jquery.browser/browser.jquery.json +37 -0
- data/app/assets/node_modules/jquery.browser/dist/jquery.browser.js +193 -0
- data/app/assets/node_modules/jquery.browser/dist/jquery.browser.min.js +14 -0
- data/app/assets/node_modules/jquery.browser/package.json +30 -0
- data/app/assets/node_modules/jquery.browser/test/casperserver.js +257 -0
- data/app/assets/node_modules/jquery.browser/test/index.html +13 -0
- data/app/assets/node_modules/jquery.browser/test/src/jquery-1.10.2.min.js +6 -0
- data/app/assets/node_modules/jquery.browser/test/src/require/test.js +21 -0
- data/app/assets/node_modules/jquery.browser/test/test.js +962 -0
- data/app/assets/node_modules/jquery.flot.tooltip/CONTRIBUTING.md +9 -0
- data/app/assets/node_modules/jquery.flot.tooltip/Gruntfile.js +72 -0
- data/app/assets/node_modules/jquery.flot.tooltip/README.md +267 -0
- data/app/assets/node_modules/jquery.flot.tooltip/bower.json +13 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/basic.html +45 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/curved-lines.html +59 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/custom-label-text.html +114 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/custom_ticks.html +78 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/dollar_in_tickformatter.html +68 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/index.html +36 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/js/curvedLines.js +483 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/js/excanvas.min.js +1 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/js/jquery.flot.js +3168 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/js/jquery.flot.pie.js +820 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/js/jquery.flot.stack.js +184 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/js/jquery.flot.threshold.js +142 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/js/jquery.flot.time.js +432 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/many_series.html +78 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/multiple-axes.html +78 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/pie.html +87 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/real_data.html +133 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/stacking.html +97 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/threshold.html +97 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/time_bars.html +77 -0
- data/app/assets/node_modules/jquery.flot.tooltip/examples/two_chars.html +63 -0
- data/app/assets/node_modules/jquery.flot.tooltip/js/jquery.flot.tooltip.js +606 -0
- data/app/assets/node_modules/jquery.flot.tooltip/js/jquery.flot.tooltip.min.js +12 -0
- data/app/assets/node_modules/jquery.flot.tooltip/js/jquery.flot.tooltip.source.js +595 -0
- data/app/assets/node_modules/jquery.flot.tooltip/package.json +37 -0
- data/app/assets/node_modules/jqvmap/CHANGELOG.md +118 -0
- data/app/assets/node_modules/jqvmap/CONTRIBUTING.md +118 -0
- data/app/assets/node_modules/jqvmap/LICENSE +43 -0
- data/app/assets/node_modules/jqvmap/README.md +495 -0
- data/app/assets/node_modules/jqvmap/REGIONS.md +405 -0
- data/app/assets/node_modules/jqvmap/bower.json +32 -0
- data/app/assets/node_modules/jqvmap/create/README.md +207 -0
- data/app/assets/node_modules/jqvmap/create/config/continent.json +64 -0
- data/app/assets/node_modules/jqvmap/create/config/new-york.json +16 -0
- data/app/assets/node_modules/jqvmap/create/config/syria.json +16 -0
- data/app/assets/node_modules/jqvmap/create/jqvmap.py +573 -0
- data/app/assets/node_modules/jqvmap/dist/jquery.vmap.js +1281 -0
- data/app/assets/node_modules/jqvmap/dist/jquery.vmap.min.js +10 -0
- data/app/assets/node_modules/jqvmap/dist/jqvmap.css +50 -0
- data/app/assets/node_modules/jqvmap/dist/jqvmap.min.css +1 -0
- data/app/assets/node_modules/jqvmap/dist/maps/continents/jquery.vmap.africa.js +2 -0
- data/app/assets/node_modules/jqvmap/dist/maps/continents/jquery.vmap.asia.js +2 -0
- data/app/assets/node_modules/jqvmap/dist/maps/continents/jquery.vmap.australia.js +2 -0
- data/app/assets/node_modules/jqvmap/dist/maps/continents/jquery.vmap.europe.js +2 -0
- data/app/assets/node_modules/jqvmap/dist/maps/continents/jquery.vmap.north-america.js +2 -0
- data/app/assets/node_modules/jqvmap/dist/maps/continents/jquery.vmap.south-america.js +2 -0
- data/app/assets/node_modules/jqvmap/dist/maps/jquery.vmap.algeria.js +2 -0
- data/app/assets/node_modules/jqvmap/dist/maps/jquery.vmap.argentina.js +1 -0
- data/app/assets/node_modules/jqvmap/dist/maps/jquery.vmap.brazil.js +2 -0
- data/app/assets/node_modules/jqvmap/dist/maps/jquery.vmap.canada.js +2 -0
- data/app/assets/node_modules/jqvmap/dist/maps/jquery.vmap.europe.js +2 -0
- data/app/assets/node_modules/jqvmap/dist/maps/jquery.vmap.france.js +1 -0
- data/app/assets/node_modules/jqvmap/dist/maps/jquery.vmap.germany.js +2 -0
- data/app/assets/node_modules/jqvmap/dist/maps/jquery.vmap.greece.js +1 -0
- data/app/assets/node_modules/jqvmap/dist/maps/jquery.vmap.iran.js +6 -0
- data/app/assets/node_modules/jqvmap/dist/maps/jquery.vmap.iraq.js +1 -0
- data/app/assets/node_modules/jqvmap/dist/maps/jquery.vmap.russia.js +2 -0
- data/app/assets/node_modules/jqvmap/dist/maps/jquery.vmap.tunisia.js +2 -0
- data/app/assets/node_modules/jqvmap/dist/maps/jquery.vmap.turkey.js +11 -0
- data/app/assets/node_modules/jqvmap/dist/maps/jquery.vmap.usa.js +2 -0
- data/app/assets/node_modules/jqvmap/dist/maps/jquery.vmap.world.js +2 -0
- data/app/assets/node_modules/jqvmap/examples/algeria.html +27 -0
- data/app/assets/node_modules/jqvmap/examples/argentina.html +33 -0
- data/app/assets/node_modules/jqvmap/examples/brazil.html +33 -0
- data/app/assets/node_modules/jqvmap/examples/continents.html +172 -0
- data/app/assets/node_modules/jqvmap/examples/europe.html +27 -0
- data/app/assets/node_modules/jqvmap/examples/france.html +27 -0
- data/app/assets/node_modules/jqvmap/examples/germany.html +33 -0
- data/app/assets/node_modules/jqvmap/examples/greece.html +33 -0
- data/app/assets/node_modules/jqvmap/examples/images/background.png +0 -0
- data/app/assets/node_modules/jqvmap/examples/images/flag.png +0 -0
- data/app/assets/node_modules/jqvmap/examples/images/globe.png +0 -0
- data/app/assets/node_modules/jqvmap/examples/images/marker/black.png +0 -0
- data/app/assets/node_modules/jqvmap/examples/images/marker/blue.png +0 -0
- data/app/assets/node_modules/jqvmap/examples/images/marker/green.png +0 -0
- data/app/assets/node_modules/jqvmap/examples/images/marker/grey.png +0 -0
- data/app/assets/node_modules/jqvmap/examples/images/marker/orange.png +0 -0
- data/app/assets/node_modules/jqvmap/examples/images/marker/purple.png +0 -0
- data/app/assets/node_modules/jqvmap/examples/images/marker/red.png +0 -0
- data/app/assets/node_modules/jqvmap/examples/images/marker/white.png +0 -0
- data/app/assets/node_modules/jqvmap/examples/images/marker/yellow.png +0 -0
- data/app/assets/node_modules/jqvmap/examples/images/thumb.jpg +0 -0
- data/app/assets/node_modules/jqvmap/examples/images/tip.png +0 -0
- data/app/assets/node_modules/jqvmap/examples/inactive_regions.html +62 -0
- data/app/assets/node_modules/jqvmap/examples/iran.html +44 -0
- data/app/assets/node_modules/jqvmap/examples/iraq.html +44 -0
- data/app/assets/node_modules/jqvmap/examples/js/jquery.vmap.sampledata.js +1 -0
- data/app/assets/node_modules/jqvmap/examples/labels.html +146 -0
- data/app/assets/node_modules/jqvmap/examples/mobile.html +59 -0
- data/app/assets/node_modules/jqvmap/examples/multi.html +29 -0
- data/app/assets/node_modules/jqvmap/examples/pins.html +236 -0
- data/app/assets/node_modules/jqvmap/examples/pins_custom.html +127 -0
- data/app/assets/node_modules/jqvmap/examples/responsive.html +45 -0
- data/app/assets/node_modules/jqvmap/examples/russia.html +33 -0
- data/app/assets/node_modules/jqvmap/examples/touch_detect.html +46 -0
- data/app/assets/node_modules/jqvmap/examples/tunisia.html +33 -0
- data/app/assets/node_modules/jqvmap/examples/turkey.html +26 -0
- data/app/assets/node_modules/jqvmap/examples/usa.html +37 -0
- data/app/assets/node_modules/jqvmap/examples/world.html +35 -0
- data/app/assets/node_modules/jqvmap/grunt/bump.js +22 -0
- data/app/assets/node_modules/jqvmap/grunt/changelog.js +14 -0
- data/app/assets/node_modules/jqvmap/grunt/clean.js +5 -0
- data/app/assets/node_modules/jqvmap/grunt/concat.js +23 -0
- data/app/assets/node_modules/jqvmap/grunt/index.js +2 -0
- data/app/assets/node_modules/jqvmap/grunt/qunit.js +3 -0
- data/app/assets/node_modules/jqvmap/grunt/shell.js +6 -0
- data/app/assets/node_modules/jqvmap/grunt/uglify.js +19 -0
- data/app/assets/node_modules/jqvmap/gruntfile.js +21 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/AUTHORS.txt +217 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/CONTRIBUTING.md +214 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/MIT-LICENSE.txt +21 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/README.md +368 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/bower.json +28 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/dist/jquery.js +10351 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/dist/jquery.min.js +6 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/dist/jquery.min.map +1 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/package.json +54 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/ajax/jsonp.js +89 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/ajax/load.js +75 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/ajax/parseJSON.js +51 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/ajax/parseXML.js +31 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/ajax/script.js +93 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/ajax/var/nonce.js +5 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/ajax/var/rquery.js +3 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/ajax/xhr.js +197 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/ajax.js +801 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/attributes/attr.js +271 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/attributes/classes.js +157 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/attributes/prop.js +134 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/attributes/support.js +62 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/attributes/val.js +178 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/attributes.js +11 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/callbacks.js +205 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/core/access.js +60 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/core/init.js +132 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/core/parseHTML.js +39 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/core/ready.js +152 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/core/var/rsingleTag.js +4 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/core.js +540 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/css/addGetHookIf.js +32 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/css/curCSS.js +124 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/css/defaultDisplay.js +69 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/css/hiddenVisibleSelectors.js +20 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/css/support.js +151 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/css/swap.js +28 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/css/var/cssExpand.js +3 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/css/var/isHidden.js +13 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/css/var/rmargin.js +3 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/css/var/rnumnonpx.js +5 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/css.js +504 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/data/accepts.js +21 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/data/support.js +25 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/data.js +335 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/deferred.js +150 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/deprecated.js +13 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/dimensions.js +50 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/effects/Tween.js +114 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/effects/animatedSelector.js +13 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/effects/support.js +55 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/effects.js +656 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/event/ajax.js +13 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/event/alias.js +39 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/event/support.js +26 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/event.js +1037 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/exports/amd.js +24 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/exports/global.js +32 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/intro.js +44 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/jquery.js +38 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/manipulation/_evalUrl.js +18 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/manipulation/support.js +76 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/manipulation.js +744 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/offset.js +211 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/outro.js +1 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/queue/delay.js +22 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/queue.js +142 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/selector-sizzle.js +14 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/selector.js +1 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/serialize.js +110 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/sizzle/dist/sizzle.js +2067 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/sizzle/dist/sizzle.min.js +3 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/sizzle/dist/sizzle.min.map +1 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/sizzle/test/data/empty.js +0 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/sizzle/test/data/mixed_sort.html +22 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/sizzle/test/data/testinit.js +136 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/sizzle/test/index.html +242 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/sizzle/test/jquery.js +9597 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/sizzle/test/unit/extending.js +95 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/sizzle/test/unit/selector.js +1149 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/sizzle/test/unit/utilities.js +169 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/support.js +58 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/traversing/findFilter.js +100 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/traversing.js +200 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/var/class2type.js +4 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/var/concat.js +5 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/var/deletedIds.js +3 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/var/hasOwn.js +5 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/var/indexOf.js +5 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/var/pnum.js +3 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/var/push.js +5 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/var/rnotwhite.js +3 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/var/slice.js +5 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/var/strundefined.js +3 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/var/support.js +4 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/var/toString.js +5 -0
- data/app/assets/node_modules/jqvmap/node_modules/jquery/src/wrap.js +76 -0
- data/app/assets/node_modules/jqvmap/package.json +45 -0
- data/app/assets/node_modules/jqvmap/src/Base.js +80 -0
- data/app/assets/node_modules/jqvmap/src/ColorScale/arrayToRgb.js +9 -0
- data/app/assets/node_modules/jqvmap/src/ColorScale/getColor.js +41 -0
- data/app/assets/node_modules/jqvmap/src/ColorScale/rgbToArray.js +4 -0
- data/app/assets/node_modules/jqvmap/src/ColorScale/setColors.js +6 -0
- data/app/assets/node_modules/jqvmap/src/ColorScale/setMax.js +8 -0
- data/app/assets/node_modules/jqvmap/src/ColorScale/setMin.js +9 -0
- data/app/assets/node_modules/jqvmap/src/ColorScale/setNormalizeFunction.js +13 -0
- data/app/assets/node_modules/jqvmap/src/ColorScale/vectorAdd.js +7 -0
- data/app/assets/node_modules/jqvmap/src/ColorScale/vectorLength.js +7 -0
- data/app/assets/node_modules/jqvmap/src/ColorScale/vectorMult.js +7 -0
- data/app/assets/node_modules/jqvmap/src/ColorScale/vectorSubtract.js +7 -0
- data/app/assets/node_modules/jqvmap/src/ColorScale/vectorToNum.js +7 -0
- data/app/assets/node_modules/jqvmap/src/ColorScale.js +18 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/applyTransform.js +31 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/bindZoomButtons.js +9 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/deselect.js +18 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/getCountryId.js +3 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/getPin.js +4 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/getPinId.js +3 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/getPins.js +11 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/highlight.js +12 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/isSelected.js +3 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/makeDraggable.js +159 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/placePins.js +46 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/positionPins.js +19 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/removePin.js +4 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/removePins.js +3 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/reset.js +9 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/resize.js +13 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/select.js +18 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/selectIndex.js +9 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/setBackgroundColor.js +3 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/setColors.js +15 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/setNormalizeFunction.js +7 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/setScale.js +4 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/setScaleColors.js +7 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/setValues.js +36 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/unhighlight.js +8 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/zoomIn.js +17 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap/zoomOut.js +17 -0
- data/app/assets/node_modules/jqvmap/src/JQVMap.js +243 -0
- data/app/assets/node_modules/jqvmap/src/VectorCanvas/applyTransformParams.js +8 -0
- data/app/assets/node_modules/jqvmap/src/VectorCanvas/createGroup.js +19 -0
- data/app/assets/node_modules/jqvmap/src/VectorCanvas/createPath.js +75 -0
- data/app/assets/node_modules/jqvmap/src/VectorCanvas/pathSvgToVml.js +103 -0
- data/app/assets/node_modules/jqvmap/src/VectorCanvas/setSize.js +24 -0
- data/app/assets/node_modules/jqvmap/src/VectorCanvas.js +42 -0
- data/app/assets/node_modules/jqvmap/tests/index.html +32 -0
- data/app/assets/node_modules/jqvmap/tests/qunit/qunit.css +291 -0
- data/app/assets/node_modules/jqvmap/tests/qunit/qunit.js +3828 -0
- data/app/assets/node_modules/jqvmap/tests/tests.js +422 -0
- data/app/assets/node_modules/metismenu/LICENSE +20 -0
- data/app/assets/node_modules/metismenu/README.md +361 -0
- data/app/assets/node_modules/metismenu/changelog.md +22 -0
- data/app/assets/node_modules/metismenu/dist/cjs/index.js +327 -0
- data/app/assets/node_modules/metismenu/dist/metisMenu.css +132 -0
- data/app/assets/node_modules/metismenu/dist/metisMenu.css.map +1 -0
- data/app/assets/node_modules/metismenu/dist/metisMenu.js +332 -0
- data/app/assets/node_modules/metismenu/dist/metisMenu.js.map +1 -0
- data/app/assets/node_modules/metismenu/dist/metisMenu.min.css +9 -0
- data/app/assets/node_modules/metismenu/dist/metisMenu.min.css.map +1 -0
- data/app/assets/node_modules/metismenu/dist/metisMenu.min.js +10 -0
- data/app/assets/node_modules/metismenu/dist/metisMenu.min.js.map +1 -0
- data/app/assets/node_modules/metismenu/dist/modules/index.js +323 -0
- data/app/assets/node_modules/metismenu/package.json +122 -0
- data/app/assets/node_modules/metismenu/src/index.js +260 -0
- data/app/assets/node_modules/metismenu/src/metisMenu.css +116 -0
- data/app/assets/node_modules/metismenu/src/util.js +61 -0
- data/app/assets/node_modules/metismenu/types/metismenu.d.ts +25 -0
- data/app/assets/node_modules/morris.js/Gruntfile.js +90 -0
- data/app/assets/node_modules/morris.js/README.md +234 -0
- data/app/assets/node_modules/morris.js/bower.json +20 -0
- data/app/assets/node_modules/morris.js/bower.travis.json +20 -0
- data/app/assets/node_modules/morris.js/examples/_template.html +18 -0
- data/app/assets/node_modules/morris.js/examples/area-as-line.html +31 -0
- data/app/assets/node_modules/morris.js/examples/area.html +34 -0
- data/app/assets/node_modules/morris.js/examples/bar-colors.html +44 -0
- data/app/assets/node_modules/morris.js/examples/bar-no-axes.html +31 -0
- data/app/assets/node_modules/morris.js/examples/bar.html +32 -0
- data/app/assets/node_modules/morris.js/examples/days.html +37 -0
- data/app/assets/node_modules/morris.js/examples/decimal-custom-hover.html +37 -0
- data/app/assets/node_modules/morris.js/examples/diagonal-xlabels-bar.html +38 -0
- data/app/assets/node_modules/morris.js/examples/diagonal-xlabels.html +38 -0
- data/app/assets/node_modules/morris.js/examples/donut-colors.html +38 -0
- data/app/assets/node_modules/morris.js/examples/donut-formatter.html +27 -0
- data/app/assets/node_modules/morris.js/examples/donut.html +29 -0
- data/app/assets/node_modules/morris.js/examples/dst.html +30 -0
- data/app/assets/node_modules/morris.js/examples/events.html +57 -0
- data/app/assets/node_modules/morris.js/examples/goals.html +33 -0
- data/app/assets/node_modules/morris.js/examples/lib/example.css +13 -0
- data/app/assets/node_modules/morris.js/examples/lib/example.js +4 -0
- data/app/assets/node_modules/morris.js/examples/months-no-smooth.html +38 -0
- data/app/assets/node_modules/morris.js/examples/negative.html +36 -0
- data/app/assets/node_modules/morris.js/examples/no-grid.html +38 -0
- data/app/assets/node_modules/morris.js/examples/non-continuous.html +42 -0
- data/app/assets/node_modules/morris.js/examples/non-date.html +37 -0
- data/app/assets/node_modules/morris.js/examples/quarters.html +54 -0
- data/app/assets/node_modules/morris.js/examples/resize.html +42 -0
- data/app/assets/node_modules/morris.js/examples/stacked_bars.html +31 -0
- data/app/assets/node_modules/morris.js/examples/timestamps.html +38 -0
- data/app/assets/node_modules/morris.js/examples/updating.html +49 -0
- data/app/assets/node_modules/morris.js/examples/weeks.html +53 -0
- data/app/assets/node_modules/morris.js/examples/years.html +37 -0
- data/app/assets/node_modules/morris.js/less/morris.core.less +27 -0
- data/app/assets/node_modules/morris.js/lib/morris.area.coffee +66 -0
- data/app/assets/node_modules/morris.js/lib/morris.bar.coffee +208 -0
- data/app/assets/node_modules/morris.js/lib/morris.coffee +43 -0
- data/app/assets/node_modules/morris.js/lib/morris.donut.coffee +213 -0
- data/app/assets/node_modules/morris.js/lib/morris.grid.coffee +499 -0
- data/app/assets/node_modules/morris.js/lib/morris.hover.coffee +44 -0
- data/app/assets/node_modules/morris.js/lib/morris.line.coffee +405 -0
- data/app/assets/node_modules/morris.js/morris.css +2 -0
- data/app/assets/node_modules/morris.js/morris.js +1892 -0
- data/app/assets/node_modules/morris.js/morris.min.js +7 -0
- data/app/assets/node_modules/morris.js/package.json +36 -0
- data/app/assets/node_modules/morris.js/spec/lib/area/area_spec.coffee +60 -0
- data/app/assets/node_modules/morris.js/spec/lib/bar/bar_spec.coffee +127 -0
- data/app/assets/node_modules/morris.js/spec/lib/bar/colours.coffee +36 -0
- data/app/assets/node_modules/morris.js/spec/lib/commas_spec.coffee +38 -0
- data/app/assets/node_modules/morris.js/spec/lib/donut/donut_spec.coffee +76 -0
- data/app/assets/node_modules/morris.js/spec/lib/grid/auto_grid_lines_spec.coffee +25 -0
- data/app/assets/node_modules/morris.js/spec/lib/grid/set_data_spec.coffee +208 -0
- data/app/assets/node_modules/morris.js/spec/lib/grid/y_label_format_spec.coffee +15 -0
- data/app/assets/node_modules/morris.js/spec/lib/hover_spec.coffee +64 -0
- data/app/assets/node_modules/morris.js/spec/lib/label_series_spec.coffee +186 -0
- data/app/assets/node_modules/morris.js/spec/lib/line/line_spec.coffee +211 -0
- data/app/assets/node_modules/morris.js/spec/lib/pad_spec.coffee +17 -0
- data/app/assets/node_modules/morris.js/spec/lib/parse_time_spec.coffee +35 -0
- data/app/assets/node_modules/morris.js/spec/specs.html +34 -0
- data/app/assets/node_modules/morris.js/spec/support/placeholder.coffee +6 -0
- data/app/assets/node_modules/morris.js/spec/viz/examples.js +56 -0
- data/app/assets/node_modules/morris.js/spec/viz/exemplary/area0.png +0 -0
- data/app/assets/node_modules/morris.js/spec/viz/exemplary/bar0.png +0 -0
- data/app/assets/node_modules/morris.js/spec/viz/exemplary/line0.png +0 -0
- data/app/assets/node_modules/morris.js/spec/viz/exemplary/stacked_bar0.png +0 -0
- data/app/assets/node_modules/morris.js/spec/viz/run.sh +32 -0
- data/app/assets/node_modules/morris.js/spec/viz/test.html +34 -0
- data/app/assets/node_modules/morris.js/spec/viz/visual_specs.js +66 -0
- data/app/assets/node_modules/nprogress/History.md +110 -0
- data/app/assets/node_modules/nprogress/License.md +19 -0
- data/app/assets/node_modules/nprogress/Notes.md +25 -0
- data/app/assets/node_modules/nprogress/Readme.md +197 -0
- data/app/assets/node_modules/nprogress/bower.json +27 -0
- data/app/assets/node_modules/nprogress/component.json +19 -0
- data/app/assets/node_modules/nprogress/nprogress.css +74 -0
- data/app/assets/node_modules/nprogress/nprogress.js +476 -0
- data/app/assets/node_modules/nprogress/package.json +47 -0
- data/app/assets/node_modules/nprogress/test/component.html +26 -0
- data/app/assets/node_modules/nprogress/test/test.js +175 -0
- data/app/assets/node_modules/parchment/LICENSE +29 -0
- data/app/assets/node_modules/parchment/README.md +274 -0
- data/app/assets/node_modules/parchment/dist/parchment.js +1749 -0
- data/app/assets/node_modules/parchment/dist/parchment.js.map +1 -0
- data/app/assets/node_modules/parchment/dist/src/attributor/attributor.d.ts +17 -0
- data/app/assets/node_modules/parchment/dist/src/attributor/class.d.ts +8 -0
- data/app/assets/node_modules/parchment/dist/src/attributor/store.d.ts +15 -0
- data/app/assets/node_modules/parchment/dist/src/attributor/style.d.ts +8 -0
- data/app/assets/node_modules/parchment/dist/src/blot/abstract/blot.d.ts +63 -0
- data/app/assets/node_modules/parchment/dist/src/blot/abstract/container.d.ts +40 -0
- data/app/assets/node_modules/parchment/dist/src/blot/abstract/format.d.ts +18 -0
- data/app/assets/node_modules/parchment/dist/src/blot/abstract/leaf.d.ts +11 -0
- data/app/assets/node_modules/parchment/dist/src/blot/abstract/parent.d.ts +41 -0
- data/app/assets/node_modules/parchment/dist/src/blot/abstract/shadow.d.ts +38 -0
- data/app/assets/node_modules/parchment/dist/src/blot/block.d.ts +15 -0
- data/app/assets/node_modules/parchment/dist/src/blot/embed.d.ts +11 -0
- data/app/assets/node_modules/parchment/dist/src/blot/inline.d.ts +14 -0
- data/app/assets/node_modules/parchment/dist/src/blot/scroll.d.ts +24 -0
- data/app/assets/node_modules/parchment/dist/src/blot/text.d.ts +26 -0
- data/app/assets/node_modules/parchment/dist/src/collection/linked-list.d.ts +19 -0
- data/app/assets/node_modules/parchment/dist/src/collection/linked-node.d.ts +6 -0
- data/app/assets/node_modules/parchment/dist/src/parchment.d.ts +35 -0
- data/app/assets/node_modules/parchment/dist/src/registry.d.ts +31 -0
- data/app/assets/node_modules/parchment/package.json +44 -0
- data/app/assets/node_modules/parchment/src/attributor/attributor.ts +61 -0
- data/app/assets/node_modules/parchment/src/attributor/class.ts +44 -0
- data/app/assets/node_modules/parchment/src/attributor/store.ts +73 -0
- data/app/assets/node_modules/parchment/src/attributor/style.ts +44 -0
- data/app/assets/node_modules/parchment/src/blot/abstract/blot.ts +58 -0
- data/app/assets/node_modules/parchment/src/blot/abstract/container.ts +268 -0
- data/app/assets/node_modules/parchment/src/blot/abstract/format.ts +71 -0
- data/app/assets/node_modules/parchment/src/blot/abstract/leaf.ts +33 -0
- data/app/assets/node_modules/parchment/src/blot/abstract/shadow.ts +174 -0
- data/app/assets/node_modules/parchment/src/blot/block.ts +53 -0
- data/app/assets/node_modules/parchment/src/blot/embed.ts +29 -0
- data/app/assets/node_modules/parchment/src/blot/inline.ts +64 -0
- data/app/assets/node_modules/parchment/src/blot/scroll.ts +166 -0
- data/app/assets/node_modules/parchment/src/blot/text.ts +93 -0
- data/app/assets/node_modules/parchment/src/collection/linked-list.ts +143 -0
- data/app/assets/node_modules/parchment/src/collection/linked-node.ts +8 -0
- data/app/assets/node_modules/parchment/src/parchment.ts +46 -0
- data/app/assets/node_modules/parchment/src/registry.ts +133 -0
- data/app/assets/node_modules/parchment/tsconfig.json +9 -0
- data/app/assets/node_modules/popper.js/README.md +219 -0
- data/app/assets/node_modules/popper.js/dist/esm/popper-utils.js +1093 -0
- data/app/assets/node_modules/popper.js/dist/esm/popper-utils.js.map +1 -0
- data/app/assets/node_modules/popper.js/dist/esm/popper-utils.min.js +5 -0
- data/app/assets/node_modules/popper.js/dist/esm/popper-utils.min.js.map +1 -0
- data/app/assets/node_modules/popper.js/dist/esm/popper.js +2520 -0
- data/app/assets/node_modules/popper.js/dist/esm/popper.js.map +1 -0
- data/app/assets/node_modules/popper.js/dist/esm/popper.min.js +5 -0
- data/app/assets/node_modules/popper.js/dist/esm/popper.min.js.map +1 -0
- data/app/assets/node_modules/popper.js/dist/popper-utils.js +1042 -0
- data/app/assets/node_modules/popper.js/dist/popper-utils.js.map +1 -0
- data/app/assets/node_modules/popper.js/dist/popper-utils.min.js +5 -0
- data/app/assets/node_modules/popper.js/dist/popper-utils.min.js.map +1 -0
- data/app/assets/node_modules/popper.js/dist/popper.js +2372 -0
- data/app/assets/node_modules/popper.js/dist/popper.js.map +1 -0
- data/app/assets/node_modules/popper.js/dist/popper.min.js +5 -0
- data/app/assets/node_modules/popper.js/dist/popper.min.js.map +1 -0
- data/app/assets/node_modules/popper.js/dist/umd/popper-utils.js +1131 -0
- data/app/assets/node_modules/popper.js/dist/umd/popper-utils.js.map +1 -0
- data/app/assets/node_modules/popper.js/dist/umd/popper-utils.min.js +5 -0
- data/app/assets/node_modules/popper.js/dist/umd/popper-utils.min.js.map +1 -0
- data/app/assets/node_modules/popper.js/dist/umd/popper.js +2528 -0
- data/app/assets/node_modules/popper.js/dist/umd/popper.js.map +1 -0
- data/app/assets/node_modules/popper.js/dist/umd/popper.min.js +5 -0
- data/app/assets/node_modules/popper.js/dist/umd/popper.min.js.map +1 -0
- data/app/assets/node_modules/popper.js/index.d.ts +159 -0
- data/app/assets/node_modules/popper.js/package.json +54 -0
- data/app/assets/node_modules/quill/CHANGELOG.md +734 -0
- data/app/assets/node_modules/quill/LICENSE +30 -0
- data/app/assets/node_modules/quill/README.md +109 -0
- data/app/assets/node_modules/quill/assets/base.styl +304 -0
- data/app/assets/node_modules/quill/assets/bubble/toolbar.styl +14 -0
- data/app/assets/node_modules/quill/assets/bubble/tooltip.styl +49 -0
- data/app/assets/node_modules/quill/assets/bubble.styl +45 -0
- data/app/assets/node_modules/quill/assets/core.styl +183 -0
- data/app/assets/node_modules/quill/assets/favicon.png +0 -0
- data/app/assets/node_modules/quill/assets/icons/align-center.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/align-justify.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/align-left.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/align-right.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/attachment.svg +3 -0
- data/app/assets/node_modules/quill/assets/icons/audio.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/authorship.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/background.svg +52 -0
- data/app/assets/node_modules/quill/assets/icons/blockquote.svg +6 -0
- data/app/assets/node_modules/quill/assets/icons/bold.svg +4 -0
- data/app/assets/node_modules/quill/assets/icons/clean.svg +7 -0
- data/app/assets/node_modules/quill/assets/icons/code.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/color.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/comment.svg +3 -0
- data/app/assets/node_modules/quill/assets/icons/direction-ltr.svg +7 -0
- data/app/assets/node_modules/quill/assets/icons/direction-rtl.svg +7 -0
- data/app/assets/node_modules/quill/assets/icons/dropdown.svg +4 -0
- data/app/assets/node_modules/quill/assets/icons/embed.svg +3 -0
- data/app/assets/node_modules/quill/assets/icons/emoji.svg +6 -0
- data/app/assets/node_modules/quill/assets/icons/float-center.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/float-full.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/float-left.svg +7 -0
- data/app/assets/node_modules/quill/assets/icons/float-right.svg +7 -0
- data/app/assets/node_modules/quill/assets/icons/font.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/formula.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/hashtag.svg +6 -0
- data/app/assets/node_modules/quill/assets/icons/header-2.svg +3 -0
- data/app/assets/node_modules/quill/assets/icons/header-3.svg +3 -0
- data/app/assets/node_modules/quill/assets/icons/header-4.svg +3 -0
- data/app/assets/node_modules/quill/assets/icons/header-5.svg +3 -0
- data/app/assets/node_modules/quill/assets/icons/header-6.svg +3 -0
- data/app/assets/node_modules/quill/assets/icons/header.svg +3 -0
- data/app/assets/node_modules/quill/assets/icons/horizontal-rule.svg +4 -0
- data/app/assets/node_modules/quill/assets/icons/image.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/indent.svg +6 -0
- data/app/assets/node_modules/quill/assets/icons/italic.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/link.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/list-bullet.svg +8 -0
- data/app/assets/node_modules/quill/assets/icons/list-check.svg +8 -0
- data/app/assets/node_modules/quill/assets/icons/list-ordered.svg +9 -0
- data/app/assets/node_modules/quill/assets/icons/map.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/mention.svg +4 -0
- data/app/assets/node_modules/quill/assets/icons/more.svg +3 -0
- data/app/assets/node_modules/quill/assets/icons/outdent.svg +6 -0
- data/app/assets/node_modules/quill/assets/icons/redo.svg +4 -0
- data/app/assets/node_modules/quill/assets/icons/size-decrease.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/size-increase.svg +6 -0
- data/app/assets/node_modules/quill/assets/icons/size.svg +6 -0
- data/app/assets/node_modules/quill/assets/icons/spacing.svg +9 -0
- data/app/assets/node_modules/quill/assets/icons/speech.svg +6 -0
- data/app/assets/node_modules/quill/assets/icons/strike.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/subscript.svg +4 -0
- data/app/assets/node_modules/quill/assets/icons/superscript.svg +4 -0
- data/app/assets/node_modules/quill/assets/icons/table-border-all.svg +5 -0
- data/app/assets/node_modules/quill/assets/icons/table-border-bottom.svg +28 -0
- data/app/assets/node_modules/quill/assets/icons/table-border-left.svg +28 -0
- data/app/assets/node_modules/quill/assets/icons/table-border-none.svg +25 -0
- data/app/assets/node_modules/quill/assets/icons/table-border-outside.svg +35 -0
- data/app/assets/node_modules/quill/assets/icons/table-border-right.svg +28 -0
- data/app/assets/node_modules/quill/assets/icons/table-border-top.svg +28 -0
- data/app/assets/node_modules/quill/assets/icons/table-delete-cells.svg +13 -0
- data/app/assets/node_modules/quill/assets/icons/table-delete-columns.svg +8 -0
- data/app/assets/node_modules/quill/assets/icons/table-delete-rows.svg +9 -0
- data/app/assets/node_modules/quill/assets/icons/table-insert-cells.svg +13 -0
- data/app/assets/node_modules/quill/assets/icons/table-insert-columns.svg +8 -0
- data/app/assets/node_modules/quill/assets/icons/table-insert-rows.svg +9 -0
- data/app/assets/node_modules/quill/assets/icons/table-merge-cells.svg +4 -0
- data/app/assets/node_modules/quill/assets/icons/table-unmerge-cells.svg +7 -0
- data/app/assets/node_modules/quill/assets/icons/table.svg +11 -0
- data/app/assets/node_modules/quill/assets/icons/underline.svg +4 -0
- data/app/assets/node_modules/quill/assets/icons/undo.svg +4 -0
- data/app/assets/node_modules/quill/assets/icons/video.svg +14 -0
- data/app/assets/node_modules/quill/assets/snow/toolbar.styl +26 -0
- data/app/assets/node_modules/quill/assets/snow/tooltip.styl +53 -0
- data/app/assets/node_modules/quill/assets/snow.styl +18 -0
- data/app/assets/node_modules/quill/blots/block.js +174 -0
- data/app/assets/node_modules/quill/blots/break.js +29 -0
- data/app/assets/node_modules/quill/blots/container.js +9 -0
- data/app/assets/node_modules/quill/blots/cursor.js +116 -0
- data/app/assets/node_modules/quill/blots/embed.js +79 -0
- data/app/assets/node_modules/quill/blots/inline.js +50 -0
- data/app/assets/node_modules/quill/blots/scroll.js +173 -0
- data/app/assets/node_modules/quill/blots/text.js +5 -0
- data/app/assets/node_modules/quill/core/editor.js +267 -0
- data/app/assets/node_modules/quill/core/emitter.js +63 -0
- data/app/assets/node_modules/quill/core/logger.js +22 -0
- data/app/assets/node_modules/quill/core/module.js +10 -0
- data/app/assets/node_modules/quill/core/polyfill.js +63 -0
- data/app/assets/node_modules/quill/core/quill.js +506 -0
- data/app/assets/node_modules/quill/core/selection.js +355 -0
- data/app/assets/node_modules/quill/core/theme.js +30 -0
- data/app/assets/node_modules/quill/core.js +36 -0
- data/app/assets/node_modules/quill/dist/quill.bubble.css +952 -0
- data/app/assets/node_modules/quill/dist/quill.core.css +397 -0
- data/app/assets/node_modules/quill/dist/quill.core.js +8522 -0
- data/app/assets/node_modules/quill/dist/quill.js +11489 -0
- data/app/assets/node_modules/quill/dist/quill.min.js +8 -0
- data/app/assets/node_modules/quill/dist/quill.min.js.map +1 -0
- data/app/assets/node_modules/quill/dist/quill.snow.css +945 -0
- data/app/assets/node_modules/quill/formats/align.js +12 -0
- data/app/assets/node_modules/quill/formats/background.js +11 -0
- data/app/assets/node_modules/quill/formats/blockquote.js +9 -0
- data/app/assets/node_modules/quill/formats/bold.js +22 -0
- data/app/assets/node_modules/quill/formats/code.js +118 -0
- data/app/assets/node_modules/quill/formats/color.js +21 -0
- data/app/assets/node_modules/quill/formats/direction.js +12 -0
- data/app/assets/node_modules/quill/formats/font.js +18 -0
- data/app/assets/node_modules/quill/formats/header.js +13 -0
- data/app/assets/node_modules/quill/formats/image.js +57 -0
- data/app/assets/node_modules/quill/formats/indent.js +31 -0
- data/app/assets/node_modules/quill/formats/italic.js +7 -0
- data/app/assets/node_modules/quill/formats/link.js +41 -0
- data/app/assets/node_modules/quill/formats/list.js +130 -0
- data/app/assets/node_modules/quill/formats/script.js +23 -0
- data/app/assets/node_modules/quill/formats/size.js +12 -0
- data/app/assets/node_modules/quill/formats/strike.js +7 -0
- data/app/assets/node_modules/quill/formats/underline.js +7 -0
- data/app/assets/node_modules/quill/formats/video.js +53 -0
- data/app/assets/node_modules/quill/modules/clipboard.js +358 -0
- data/app/assets/node_modules/quill/modules/formula.js +42 -0
- data/app/assets/node_modules/quill/modules/history.js +120 -0
- data/app/assets/node_modules/quill/modules/keyboard.js +494 -0
- data/app/assets/node_modules/quill/modules/syntax.js +81 -0
- data/app/assets/node_modules/quill/modules/toolbar.js +261 -0
- data/app/assets/node_modules/quill/package.json +99 -0
- data/app/assets/node_modules/quill/quill.js +104 -0
- data/app/assets/node_modules/quill/themes/base.js +264 -0
- data/app/assets/node_modules/quill/themes/bubble.js +111 -0
- data/app/assets/node_modules/quill/themes/snow.js +120 -0
- data/app/assets/node_modules/quill/ui/color-picker.js +35 -0
- data/app/assets/node_modules/quill/ui/icon-picker.js +23 -0
- data/app/assets/node_modules/quill/ui/icons.js +49 -0
- data/app/assets/node_modules/quill/ui/picker.js +186 -0
- data/app/assets/node_modules/quill/ui/tooltip.js +53 -0
- data/app/assets/node_modules/quill-delta/CHANGELOG.md +48 -0
- data/app/assets/node_modules/quill-delta/LICENSE +21 -0
- data/app/assets/node_modules/quill-delta/README.md +639 -0
- data/app/assets/node_modules/quill-delta/lib/delta.js +325 -0
- data/app/assets/node_modules/quill-delta/lib/op.js +139 -0
- data/app/assets/node_modules/quill-delta/package.json +40 -0
- data/app/assets/node_modules/raphael/CONTRIBUTING.md +22 -0
- data/app/assets/node_modules/raphael/Gruntfile.js +72 -0
- data/app/assets/node_modules/raphael/README.md +75 -0
- data/app/assets/node_modules/raphael/bower.json +31 -0
- data/app/assets/node_modules/raphael/dev/banner.txt +8 -0
- data/app/assets/node_modules/raphael/dev/raphael.amd.js +5 -0
- data/app/assets/node_modules/raphael/dev/raphael.core.js +5405 -0
- data/app/assets/node_modules/raphael/dev/raphael.svg.js +1424 -0
- data/app/assets/node_modules/raphael/dev/raphael.vml.js +999 -0
- data/app/assets/node_modules/raphael/dev/raphaelTest.html +39 -0
- data/app/assets/node_modules/raphael/dev/test/index.html +31 -0
- data/app/assets/node_modules/raphael/dev/test/svg/dom.js +317 -0
- data/app/assets/node_modules/raphael/dev/test/vml/dom.js +5 -0
- data/app/assets/node_modules/raphael/history.md +155 -0
- data/app/assets/node_modules/raphael/license.txt +21 -0
- data/app/assets/node_modules/raphael/package.json +47 -0
- data/app/assets/node_modules/raphael/raphael.js +8353 -0
- data/app/assets/node_modules/raphael/raphael.min.js +3 -0
- data/app/assets/node_modules/raphael/raphael.no-deps.js +7927 -0
- data/app/assets/node_modules/raphael/raphael.no-deps.min.js +3 -0
- data/app/assets/node_modules/raphael/webpack.config.js +64 -0
- data/app/assets/node_modules/raphael/yarn.lock +2012 -0
- data/app/assets/node_modules/responsive-toolkit/CHANGELOG.md +70 -0
- data/app/assets/node_modules/responsive-toolkit/LICENSE +21 -0
- data/app/assets/node_modules/responsive-toolkit/README.md +155 -0
- data/app/assets/node_modules/responsive-toolkit/bower.json +22 -0
- data/app/assets/node_modules/responsive-toolkit/demos/bootstrap/index.html +53 -0
- data/app/assets/node_modules/responsive-toolkit/demos/bootstrap/main.js +42 -0
- data/app/assets/node_modules/responsive-toolkit/demos/bootstrap/style.css +109 -0
- data/app/assets/node_modules/responsive-toolkit/demos/custom/index.html +23 -0
- data/app/assets/node_modules/responsive-toolkit/demos/custom/main.js +36 -0
- data/app/assets/node_modules/responsive-toolkit/demos/custom/style.css +19 -0
- data/app/assets/node_modules/responsive-toolkit/demos/foundation/index.html +25 -0
- data/app/assets/node_modules/responsive-toolkit/demos/foundation/main.js +28 -0
- data/app/assets/node_modules/responsive-toolkit/demos/foundation/style.css +3 -0
- data/app/assets/node_modules/responsive-toolkit/dist/bootstrap-toolkit-1.5.0.js +49 -0
- data/app/assets/node_modules/responsive-toolkit/dist/bootstrap-toolkit-1.5.0.min.js +8 -0
- data/app/assets/node_modules/responsive-toolkit/dist/bootstrap-toolkit.js +238 -0
- data/app/assets/node_modules/responsive-toolkit/dist/bootstrap-toolkit.min.js +8 -0
- data/app/assets/node_modules/responsive-toolkit/gulpfile.js +38 -0
- data/app/assets/node_modules/responsive-toolkit/package.json +28 -0
- data/app/assets/node_modules/responsive-toolkit/src/bootstrap-toolkit.js +238 -0
- data/app/assets/node_modules/sortablejs/README.md +636 -0
- data/app/assets/node_modules/sortablejs/Sortable.js +1540 -0
- data/app/assets/node_modules/sortablejs/Sortable.min.js +2 -0
- data/app/assets/node_modules/sortablejs/package.json +48 -0
- data/app/assets/node_modules/tether/CHANGELOG.md +13 -0
- data/app/assets/node_modules/tether/CONTRIBUTING.md +59 -0
- data/app/assets/node_modules/tether/LICENSE +8 -0
- data/app/assets/node_modules/tether/README.md +116 -0
- data/app/assets/node_modules/tether/bower.json +26 -0
- data/app/assets/node_modules/tether/component.json +22 -0
- data/app/assets/node_modules/tether/dist/css/tether-theme-arrows-dark.css +150 -0
- data/app/assets/node_modules/tether/dist/css/tether-theme-arrows-dark.min.css +1 -0
- data/app/assets/node_modules/tether/dist/css/tether-theme-arrows.css +153 -0
- data/app/assets/node_modules/tether/dist/css/tether-theme-arrows.min.css +1 -0
- data/app/assets/node_modules/tether/dist/css/tether-theme-basic.css +21 -0
- data/app/assets/node_modules/tether/dist/css/tether-theme-basic.min.css +1 -0
- data/app/assets/node_modules/tether/dist/css/tether.css +8 -0
- data/app/assets/node_modules/tether/dist/css/tether.min.css +1 -0
- data/app/assets/node_modules/tether/dist/js/tether.js +1813 -0
- data/app/assets/node_modules/tether/dist/js/tether.min.js +1 -0
- data/app/assets/node_modules/tether/docs/1-Overview/1-why_you_should_use_tether.md +43 -0
- data/app/assets/node_modules/tether/docs/1-Overview/2-repositioning.md +46 -0
- data/app/assets/node_modules/tether/docs/1-Overview/3-why_we_dont_support_IE_8.md +47 -0
- data/app/assets/node_modules/tether/docs/2-Examples/1-list_of_examples.md +27 -0
- data/app/assets/node_modules/tether/docs/2-Examples/2-projects_using_tether.md +45 -0
- data/app/assets/node_modules/tether/docs/3-Advanced/1-embedding_tether.md +9 -0
- data/app/assets/node_modules/tether/docs/3-Advanced/2-extending_tether.md +54 -0
- data/app/assets/node_modules/tether/docs/coffee/intro.coffee +113 -0
- data/app/assets/node_modules/tether/docs/css/intro.css +218 -0
- data/app/assets/node_modules/tether/docs/intro.md +591 -0
- data/app/assets/node_modules/tether/docs/js/intro.js +117 -0
- data/app/assets/node_modules/tether/docs/js/markAttachment.js +51 -0
- data/app/assets/node_modules/tether/docs/sass/intro.sass +233 -0
- data/app/assets/node_modules/tether/docs/welcome/browser-demo.html +76 -0
- data/app/assets/node_modules/tether/docs/welcome/coffee/welcome.coffee +212 -0
- data/app/assets/node_modules/tether/docs/welcome/css/browser-demo.css +86 -0
- data/app/assets/node_modules/tether/docs/welcome/css/prism.css +2 -0
- data/app/assets/node_modules/tether/docs/welcome/css/welcome.css +247 -0
- data/app/assets/node_modules/tether/docs/welcome/index.html +226 -0
- data/app/assets/node_modules/tether/docs/welcome/js/drop.js +239 -0
- data/app/assets/node_modules/tether/docs/welcome/js/jquery.js +9597 -0
- data/app/assets/node_modules/tether/docs/welcome/js/log.js +134 -0
- data/app/assets/node_modules/tether/docs/welcome/js/tether-v0.1.3.js +2 -0
- data/app/assets/node_modules/tether/docs/welcome/js/welcome.js +193 -0
- data/app/assets/node_modules/tether/docs/welcome/sass/_inline-block.sass +6 -0
- data/app/assets/node_modules/tether/docs/welcome/sass/browser-demo.sass +93 -0
- data/app/assets/node_modules/tether/docs/welcome/sass/welcome.sass +285 -0
- data/app/assets/node_modules/tether/examples/chosen/chosen-sprite.png +0 -0
- data/app/assets/node_modules/tether/examples/chosen/chosen-sprite@2x.png +0 -0
- data/app/assets/node_modules/tether/examples/chosen/chosen.css +430 -0
- data/app/assets/node_modules/tether/examples/chosen/chosen.js +1166 -0
- data/app/assets/node_modules/tether/examples/chosen/index.html +110 -0
- data/app/assets/node_modules/tether/examples/common/css/style.css +48 -0
- data/app/assets/node_modules/tether/examples/content-visible/index.html +64 -0
- data/app/assets/node_modules/tether/examples/dolls/dolls.css +18 -0
- data/app/assets/node_modules/tether/examples/dolls/dolls.js +83 -0
- data/app/assets/node_modules/tether/examples/dolls/index.html +7 -0
- data/app/assets/node_modules/tether/examples/element-scroll/index.html +499 -0
- data/app/assets/node_modules/tether/examples/enable-disable/index.html +37 -0
- data/app/assets/node_modules/tether/examples/facebook/facebook.css +86 -0
- data/app/assets/node_modules/tether/examples/facebook/index.html +209 -0
- data/app/assets/node_modules/tether/examples/out-of-bounds/index.html +38 -0
- data/app/assets/node_modules/tether/examples/pin/index.html +30 -0
- data/app/assets/node_modules/tether/examples/resources/css/base.css +10 -0
- data/app/assets/node_modules/tether/examples/resources/js/jquery.js +9597 -0
- data/app/assets/node_modules/tether/examples/resources/js/log.js +134 -0
- data/app/assets/node_modules/tether/examples/scroll/index.html +922 -0
- data/app/assets/node_modules/tether/examples/simple/index.html +30 -0
- data/app/assets/node_modules/tether/examples/testbed/index.html +36 -0
- data/app/assets/node_modules/tether/examples/tooltip/index.html +86 -0
- data/app/assets/node_modules/tether/examples/viewport/colors.css +145 -0
- data/app/assets/node_modules/tether/examples/viewport/index.html +70 -0
- data/app/assets/node_modules/tether/gulpfile.js +97 -0
- data/app/assets/node_modules/tether/package.json +40 -0
- data/app/assets/node_modules/tether/src/css/helpers/_tether-theme-arrows.sass +192 -0
- data/app/assets/node_modules/tether/src/css/helpers/_tether-theme-basic.sass +14 -0
- data/app/assets/node_modules/tether/src/css/helpers/_tether.sass +12 -0
- data/app/assets/node_modules/tether/src/css/mixins/_inline-block.sass +6 -0
- data/app/assets/node_modules/tether/src/css/mixins/_pie-clearfix.sass +7 -0
- data/app/assets/node_modules/tether/src/css/tether-theme-arrows-dark.sass +12 -0
- data/app/assets/node_modules/tether/src/css/tether-theme-arrows.sass +12 -0
- data/app/assets/node_modules/tether/src/css/tether-theme-basic.sass +10 -0
- data/app/assets/node_modules/tether/src/css/tether.sass +5 -0
- data/app/assets/node_modules/tether/src/js/abutment.js +61 -0
- data/app/assets/node_modules/tether/src/js/constraint.js +366 -0
- data/app/assets/node_modules/tether/src/js/markAttachment.js +46 -0
- data/app/assets/node_modules/tether/src/js/shift.js +32 -0
- data/app/assets/node_modules/tether/src/js/tether.js +811 -0
- data/app/assets/node_modules/tether/src/js/utils.js +370 -0
- data/app/assets/node_modules/tinycolor2/Gruntfile.js +59 -0
- data/app/assets/node_modules/tinycolor2/LICENSE +20 -0
- data/app/assets/node_modules/tinycolor2/README.md +469 -0
- data/app/assets/node_modules/tinycolor2/bower.json +9 -0
- data/app/assets/node_modules/tinycolor2/demo/demo.css +23 -0
- data/app/assets/node_modules/tinycolor2/demo/jquery-1.9.1.js +9597 -0
- data/app/assets/node_modules/tinycolor2/dist/tinycolor-min.js +4 -0
- data/app/assets/node_modules/tinycolor2/docs/docco.css +192 -0
- data/app/assets/node_modules/tinycolor2/docs/tinycolor.html +1023 -0
- data/app/assets/node_modules/tinycolor2/index.html +207 -0
- data/app/assets/node_modules/tinycolor2/package.json +31 -0
- data/app/assets/node_modules/tinycolor2/test/index.html +19 -0
- data/app/assets/node_modules/tinycolor2/test/qunit.css +244 -0
- data/app/assets/node_modules/tinycolor2/test/qunit.js +2152 -0
- data/app/assets/node_modules/tinycolor2/test/test.js +791 -0
- data/app/assets/node_modules/tinycolor2/tinycolor.js +1195 -0
- data/app/assets/stylesheets/rails_modular_admin/application.scss +2 -3
- data/app/assets/stylesheets/rails_modular_admin.scss +0 -1
- data/config/initializers/assets.rb +4 -29
- data/lib/rails_modular_admin/engine.rb +30 -2
- data/lib/rails_modular_admin/version.rb +1 -1
- metadata +1419 -8
- data/app/controllers/rails_modular_admin/application_controller.rb +0 -5
- data/app/helpers/rails_modular_admin/application_helper.rb +0 -4
- data/app/jobs/rails_modular_admin/application_job.rb +0 -4
- data/app/mailers/rails_modular_admin/application_mailer.rb +0 -6
- data/app/models/rails_modular_admin/application_record.rb +0 -5
@@ -0,0 +1,1023 @@
|
|
1
|
+
<!DOCTYPE html> <html> <head> <title>tinycolor.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> tinycolor.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> <p>TinyColor v1.4.1
|
2
|
+
https://github.com/bgrins/TinyColor
|
3
|
+
Brian Grinstead, MIT License</p> </td> <td class="code"> <div class="highlight"><pre><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nb">Math</span><span class="p">)</span> <span class="p">{</span>
|
4
|
+
|
5
|
+
<span class="kd">var</span> <span class="nx">trimLeft</span> <span class="o">=</span> <span class="sr">/^\s+/</span><span class="p">,</span>
|
6
|
+
<span class="nx">trimRight</span> <span class="o">=</span> <span class="sr">/\s+$/</span><span class="p">,</span>
|
7
|
+
<span class="nx">tinyCounter</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
|
8
|
+
<span class="nx">mathRound</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">round</span><span class="p">,</span>
|
9
|
+
<span class="nx">mathMin</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">,</span>
|
10
|
+
<span class="nx">mathMax</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">,</span>
|
11
|
+
<span class="nx">mathRandom</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">random</span><span class="p">;</span>
|
12
|
+
|
13
|
+
<span class="kd">function</span> <span class="nx">tinycolor</span> <span class="p">(</span><span class="nx">color</span><span class="p">,</span> <span class="nx">opts</span><span class="p">)</span> <span class="p">{</span>
|
14
|
+
|
15
|
+
<span class="nx">color</span> <span class="o">=</span> <span class="p">(</span><span class="nx">color</span><span class="p">)</span> <span class="o">?</span> <span class="nx">color</span> <span class="o">:</span> <span class="s1">''</span><span class="p">;</span>
|
16
|
+
<span class="nx">opts</span> <span class="o">=</span> <span class="nx">opts</span> <span class="o">||</span> <span class="p">{</span> <span class="p">};</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">¶</a> </div> <p>If input is already a tinycolor, return itself</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="nx">color</span> <span class="k">instanceof</span> <span class="nx">tinycolor</span><span class="p">)</span> <span class="p">{</span>
|
17
|
+
<span class="k">return</span> <span class="nx">color</span><span class="p">;</span>
|
18
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">¶</a> </div> <p>If we are called as a function, call using new instead</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="p">(</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">tinycolor</span><span class="p">))</span> <span class="p">{</span>
|
19
|
+
<span class="k">return</span> <span class="k">new</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">,</span> <span class="nx">opts</span><span class="p">);</span>
|
20
|
+
<span class="p">}</span>
|
21
|
+
|
22
|
+
<span class="kd">var</span> <span class="nx">rgb</span> <span class="o">=</span> <span class="nx">inputToRGB</span><span class="p">(</span><span class="nx">color</span><span class="p">);</span>
|
23
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">_originalInput</span> <span class="o">=</span> <span class="nx">color</span><span class="p">,</span>
|
24
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">_r</span> <span class="o">=</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">r</span><span class="p">,</span>
|
25
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">_g</span> <span class="o">=</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">g</span><span class="p">,</span>
|
26
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">_b</span> <span class="o">=</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">b</span><span class="p">,</span>
|
27
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="o">=</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">a</span><span class="p">,</span>
|
28
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">_roundA</span> <span class="o">=</span> <span class="nx">mathRound</span><span class="p">(</span><span class="mi">100</span><span class="o">*</span><span class="k">this</span><span class="p">.</span><span class="nx">_a</span><span class="p">)</span> <span class="o">/</span> <span class="mi">100</span><span class="p">,</span>
|
29
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">_format</span> <span class="o">=</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">format</span> <span class="o">||</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">format</span><span class="p">;</span>
|
30
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">_gradientType</span> <span class="o">=</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">gradientType</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">¶</a> </div> <p>Don't let the range of [0,255] come back in [0,1].
|
31
|
+
Potentially lose a little bit of precision here, but will fix issues where
|
32
|
+
.5 gets interpreted as half of the total, instead of half of 1
|
33
|
+
If it was supposed to be 128, this was already taken care of by <code>inputToRgb</code></p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span> <span class="o"><</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span> <span class="k">this</span><span class="p">.</span><span class="nx">_r</span> <span class="o">=</span> <span class="nx">mathRound</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">);</span> <span class="p">}</span>
|
34
|
+
<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_g</span> <span class="o"><</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span> <span class="k">this</span><span class="p">.</span><span class="nx">_g</span> <span class="o">=</span> <span class="nx">mathRound</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_g</span><span class="p">);</span> <span class="p">}</span>
|
35
|
+
<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_b</span> <span class="o"><</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span> <span class="k">this</span><span class="p">.</span><span class="nx">_b</span> <span class="o">=</span> <span class="nx">mathRound</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_b</span><span class="p">);</span> <span class="p">}</span>
|
36
|
+
|
37
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">_ok</span> <span class="o">=</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">ok</span><span class="p">;</span>
|
38
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">_tc_id</span> <span class="o">=</span> <span class="nx">tinyCounter</span><span class="o">++</span><span class="p">;</span>
|
39
|
+
<span class="p">}</span>
|
40
|
+
|
41
|
+
<span class="nx">tinycolor</span><span class="p">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="p">{</span>
|
42
|
+
<span class="nx">isDark</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
43
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">getBrightness</span><span class="p">()</span> <span class="o"><</span> <span class="mi">128</span><span class="p">;</span>
|
44
|
+
<span class="p">},</span>
|
45
|
+
<span class="nx">isLight</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
46
|
+
<span class="k">return</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">isDark</span><span class="p">();</span>
|
47
|
+
<span class="p">},</span>
|
48
|
+
<span class="nx">isValid</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
49
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_ok</span><span class="p">;</span>
|
50
|
+
<span class="p">},</span>
|
51
|
+
<span class="nx">getOriginalInput</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
52
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_originalInput</span><span class="p">;</span>
|
53
|
+
<span class="p">},</span>
|
54
|
+
<span class="nx">getFormat</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
55
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_format</span><span class="p">;</span>
|
56
|
+
<span class="p">},</span>
|
57
|
+
<span class="nx">getAlpha</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
58
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_a</span><span class="p">;</span>
|
59
|
+
<span class="p">},</span>
|
60
|
+
<span class="nx">getBrightness</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">¶</a> </div> <p>http://www.w3.org/TR/AERT#color-contrast</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">rgb</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toRgb</span><span class="p">();</span>
|
61
|
+
<span class="k">return</span> <span class="p">(</span><span class="nx">rgb</span><span class="p">.</span><span class="nx">r</span> <span class="o">*</span> <span class="mi">299</span> <span class="o">+</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">g</span> <span class="o">*</span> <span class="mi">587</span> <span class="o">+</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">b</span> <span class="o">*</span> <span class="mi">114</span><span class="p">)</span> <span class="o">/</span> <span class="mi">1000</span><span class="p">;</span>
|
62
|
+
<span class="p">},</span>
|
63
|
+
<span class="nx">getLuminance</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">¶</a> </div> <p>http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">rgb</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toRgb</span><span class="p">();</span>
|
64
|
+
<span class="kd">var</span> <span class="nx">RsRGB</span><span class="p">,</span> <span class="nx">GsRGB</span><span class="p">,</span> <span class="nx">BsRGB</span><span class="p">,</span> <span class="nx">R</span><span class="p">,</span> <span class="nx">G</span><span class="p">,</span> <span class="nx">B</span><span class="p">;</span>
|
65
|
+
<span class="nx">RsRGB</span> <span class="o">=</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">r</span><span class="o">/</span><span class="mi">255</span><span class="p">;</span>
|
66
|
+
<span class="nx">GsRGB</span> <span class="o">=</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">g</span><span class="o">/</span><span class="mi">255</span><span class="p">;</span>
|
67
|
+
<span class="nx">BsRGB</span> <span class="o">=</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">b</span><span class="o">/</span><span class="mi">255</span><span class="p">;</span>
|
68
|
+
|
69
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">RsRGB</span> <span class="o"><=</span> <span class="mf">0.03928</span><span class="p">)</span> <span class="p">{</span><span class="nx">R</span> <span class="o">=</span> <span class="nx">RsRGB</span> <span class="o">/</span> <span class="mf">12.92</span><span class="p">;}</span> <span class="k">else</span> <span class="p">{</span><span class="nx">R</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">pow</span><span class="p">(((</span><span class="nx">RsRGB</span> <span class="o">+</span> <span class="mf">0.055</span><span class="p">)</span> <span class="o">/</span> <span class="mf">1.055</span><span class="p">),</span> <span class="mf">2.4</span><span class="p">);}</span>
|
70
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">GsRGB</span> <span class="o"><=</span> <span class="mf">0.03928</span><span class="p">)</span> <span class="p">{</span><span class="nx">G</span> <span class="o">=</span> <span class="nx">GsRGB</span> <span class="o">/</span> <span class="mf">12.92</span><span class="p">;}</span> <span class="k">else</span> <span class="p">{</span><span class="nx">G</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">pow</span><span class="p">(((</span><span class="nx">GsRGB</span> <span class="o">+</span> <span class="mf">0.055</span><span class="p">)</span> <span class="o">/</span> <span class="mf">1.055</span><span class="p">),</span> <span class="mf">2.4</span><span class="p">);}</span>
|
71
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">BsRGB</span> <span class="o"><=</span> <span class="mf">0.03928</span><span class="p">)</span> <span class="p">{</span><span class="nx">B</span> <span class="o">=</span> <span class="nx">BsRGB</span> <span class="o">/</span> <span class="mf">12.92</span><span class="p">;}</span> <span class="k">else</span> <span class="p">{</span><span class="nx">B</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">pow</span><span class="p">(((</span><span class="nx">BsRGB</span> <span class="o">+</span> <span class="mf">0.055</span><span class="p">)</span> <span class="o">/</span> <span class="mf">1.055</span><span class="p">),</span> <span class="mf">2.4</span><span class="p">);}</span>
|
72
|
+
<span class="k">return</span> <span class="p">(</span><span class="mf">0.2126</span> <span class="o">*</span> <span class="nx">R</span><span class="p">)</span> <span class="o">+</span> <span class="p">(</span><span class="mf">0.7152</span> <span class="o">*</span> <span class="nx">G</span><span class="p">)</span> <span class="o">+</span> <span class="p">(</span><span class="mf">0.0722</span> <span class="o">*</span> <span class="nx">B</span><span class="p">);</span>
|
73
|
+
<span class="p">},</span>
|
74
|
+
<span class="nx">setAlpha</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
|
75
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="o">=</span> <span class="nx">boundAlpha</span><span class="p">(</span><span class="nx">value</span><span class="p">);</span>
|
76
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">_roundA</span> <span class="o">=</span> <span class="nx">mathRound</span><span class="p">(</span><span class="mi">100</span><span class="o">*</span><span class="k">this</span><span class="p">.</span><span class="nx">_a</span><span class="p">)</span> <span class="o">/</span> <span class="mi">100</span><span class="p">;</span>
|
77
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">;</span>
|
78
|
+
<span class="p">},</span>
|
79
|
+
<span class="nx">toHsv</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
80
|
+
<span class="kd">var</span> <span class="nx">hsv</span> <span class="o">=</span> <span class="nx">rgbToHsv</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_g</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_b</span><span class="p">);</span>
|
81
|
+
<span class="k">return</span> <span class="p">{</span> <span class="nx">h</span><span class="o">:</span> <span class="nx">hsv</span><span class="p">.</span><span class="nx">h</span> <span class="o">*</span> <span class="mi">360</span><span class="p">,</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">hsv</span><span class="p">.</span><span class="nx">s</span><span class="p">,</span> <span class="nx">v</span><span class="o">:</span> <span class="nx">hsv</span><span class="p">.</span><span class="nx">v</span><span class="p">,</span> <span class="nx">a</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="p">};</span>
|
82
|
+
<span class="p">},</span>
|
83
|
+
<span class="nx">toHsvString</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
84
|
+
<span class="kd">var</span> <span class="nx">hsv</span> <span class="o">=</span> <span class="nx">rgbToHsv</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_g</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_b</span><span class="p">);</span>
|
85
|
+
<span class="kd">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="nx">mathRound</span><span class="p">(</span><span class="nx">hsv</span><span class="p">.</span><span class="nx">h</span> <span class="o">*</span> <span class="mi">360</span><span class="p">),</span> <span class="nx">s</span> <span class="o">=</span> <span class="nx">mathRound</span><span class="p">(</span><span class="nx">hsv</span><span class="p">.</span><span class="nx">s</span> <span class="o">*</span> <span class="mi">100</span><span class="p">),</span> <span class="nx">v</span> <span class="o">=</span> <span class="nx">mathRound</span><span class="p">(</span><span class="nx">hsv</span><span class="p">.</span><span class="nx">v</span> <span class="o">*</span> <span class="mi">100</span><span class="p">);</span>
|
86
|
+
<span class="k">return</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="o">==</span> <span class="mi">1</span><span class="p">)</span> <span class="o">?</span>
|
87
|
+
<span class="s2">"hsv("</span> <span class="o">+</span> <span class="nx">h</span> <span class="o">+</span> <span class="s2">", "</span> <span class="o">+</span> <span class="nx">s</span> <span class="o">+</span> <span class="s2">"%, "</span> <span class="o">+</span> <span class="nx">v</span> <span class="o">+</span> <span class="s2">"%)"</span> <span class="o">:</span>
|
88
|
+
<span class="s2">"hsva("</span> <span class="o">+</span> <span class="nx">h</span> <span class="o">+</span> <span class="s2">", "</span> <span class="o">+</span> <span class="nx">s</span> <span class="o">+</span> <span class="s2">"%, "</span> <span class="o">+</span> <span class="nx">v</span> <span class="o">+</span> <span class="s2">"%, "</span><span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">_roundA</span> <span class="o">+</span> <span class="s2">")"</span><span class="p">;</span>
|
89
|
+
<span class="p">},</span>
|
90
|
+
<span class="nx">toHsl</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
91
|
+
<span class="kd">var</span> <span class="nx">hsl</span> <span class="o">=</span> <span class="nx">rgbToHsl</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_g</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_b</span><span class="p">);</span>
|
92
|
+
<span class="k">return</span> <span class="p">{</span> <span class="nx">h</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">h</span> <span class="o">*</span> <span class="mi">360</span><span class="p">,</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">s</span><span class="p">,</span> <span class="nx">l</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">l</span><span class="p">,</span> <span class="nx">a</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="p">};</span>
|
93
|
+
<span class="p">},</span>
|
94
|
+
<span class="nx">toHslString</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
95
|
+
<span class="kd">var</span> <span class="nx">hsl</span> <span class="o">=</span> <span class="nx">rgbToHsl</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_g</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_b</span><span class="p">);</span>
|
96
|
+
<span class="kd">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="nx">mathRound</span><span class="p">(</span><span class="nx">hsl</span><span class="p">.</span><span class="nx">h</span> <span class="o">*</span> <span class="mi">360</span><span class="p">),</span> <span class="nx">s</span> <span class="o">=</span> <span class="nx">mathRound</span><span class="p">(</span><span class="nx">hsl</span><span class="p">.</span><span class="nx">s</span> <span class="o">*</span> <span class="mi">100</span><span class="p">),</span> <span class="nx">l</span> <span class="o">=</span> <span class="nx">mathRound</span><span class="p">(</span><span class="nx">hsl</span><span class="p">.</span><span class="nx">l</span> <span class="o">*</span> <span class="mi">100</span><span class="p">);</span>
|
97
|
+
<span class="k">return</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="o">==</span> <span class="mi">1</span><span class="p">)</span> <span class="o">?</span>
|
98
|
+
<span class="s2">"hsl("</span> <span class="o">+</span> <span class="nx">h</span> <span class="o">+</span> <span class="s2">", "</span> <span class="o">+</span> <span class="nx">s</span> <span class="o">+</span> <span class="s2">"%, "</span> <span class="o">+</span> <span class="nx">l</span> <span class="o">+</span> <span class="s2">"%)"</span> <span class="o">:</span>
|
99
|
+
<span class="s2">"hsla("</span> <span class="o">+</span> <span class="nx">h</span> <span class="o">+</span> <span class="s2">", "</span> <span class="o">+</span> <span class="nx">s</span> <span class="o">+</span> <span class="s2">"%, "</span> <span class="o">+</span> <span class="nx">l</span> <span class="o">+</span> <span class="s2">"%, "</span><span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">_roundA</span> <span class="o">+</span> <span class="s2">")"</span><span class="p">;</span>
|
100
|
+
<span class="p">},</span>
|
101
|
+
<span class="nx">toHex</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">allow3Char</span><span class="p">)</span> <span class="p">{</span>
|
102
|
+
<span class="k">return</span> <span class="nx">rgbToHex</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_g</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_b</span><span class="p">,</span> <span class="nx">allow3Char</span><span class="p">);</span>
|
103
|
+
<span class="p">},</span>
|
104
|
+
<span class="nx">toHexString</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">allow3Char</span><span class="p">)</span> <span class="p">{</span>
|
105
|
+
<span class="k">return</span> <span class="s1">'#'</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">toHex</span><span class="p">(</span><span class="nx">allow3Char</span><span class="p">);</span>
|
106
|
+
<span class="p">},</span>
|
107
|
+
<span class="nx">toHex8</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">allow4Char</span><span class="p">)</span> <span class="p">{</span>
|
108
|
+
<span class="k">return</span> <span class="nx">rgbaToHex</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_g</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_b</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_a</span><span class="p">,</span> <span class="nx">allow4Char</span><span class="p">);</span>
|
109
|
+
<span class="p">},</span>
|
110
|
+
<span class="nx">toHex8String</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">allow4Char</span><span class="p">)</span> <span class="p">{</span>
|
111
|
+
<span class="k">return</span> <span class="s1">'#'</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">toHex8</span><span class="p">(</span><span class="nx">allow4Char</span><span class="p">);</span>
|
112
|
+
<span class="p">},</span>
|
113
|
+
<span class="nx">toRgb</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
114
|
+
<span class="k">return</span> <span class="p">{</span> <span class="nx">r</span><span class="o">:</span> <span class="nx">mathRound</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">),</span> <span class="nx">g</span><span class="o">:</span> <span class="nx">mathRound</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_g</span><span class="p">),</span> <span class="nx">b</span><span class="o">:</span> <span class="nx">mathRound</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_b</span><span class="p">),</span> <span class="nx">a</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="p">};</span>
|
115
|
+
<span class="p">},</span>
|
116
|
+
<span class="nx">toRgbString</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
117
|
+
<span class="k">return</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="o">==</span> <span class="mi">1</span><span class="p">)</span> <span class="o">?</span>
|
118
|
+
<span class="s2">"rgb("</span> <span class="o">+</span> <span class="nx">mathRound</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">)</span> <span class="o">+</span> <span class="s2">", "</span> <span class="o">+</span> <span class="nx">mathRound</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_g</span><span class="p">)</span> <span class="o">+</span> <span class="s2">", "</span> <span class="o">+</span> <span class="nx">mathRound</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_b</span><span class="p">)</span> <span class="o">+</span> <span class="s2">")"</span> <span class="o">:</span>
|
119
|
+
<span class="s2">"rgba("</span> <span class="o">+</span> <span class="nx">mathRound</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">)</span> <span class="o">+</span> <span class="s2">", "</span> <span class="o">+</span> <span class="nx">mathRound</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_g</span><span class="p">)</span> <span class="o">+</span> <span class="s2">", "</span> <span class="o">+</span> <span class="nx">mathRound</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_b</span><span class="p">)</span> <span class="o">+</span> <span class="s2">", "</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">_roundA</span> <span class="o">+</span> <span class="s2">")"</span><span class="p">;</span>
|
120
|
+
<span class="p">},</span>
|
121
|
+
<span class="nx">toPercentageRgb</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
122
|
+
<span class="k">return</span> <span class="p">{</span> <span class="nx">r</span><span class="o">:</span> <span class="nx">mathRound</span><span class="p">(</span><span class="nx">bound01</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">,</span> <span class="mi">255</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"%"</span><span class="p">,</span> <span class="nx">g</span><span class="o">:</span> <span class="nx">mathRound</span><span class="p">(</span><span class="nx">bound01</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_g</span><span class="p">,</span> <span class="mi">255</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"%"</span><span class="p">,</span> <span class="nx">b</span><span class="o">:</span> <span class="nx">mathRound</span><span class="p">(</span><span class="nx">bound01</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_b</span><span class="p">,</span> <span class="mi">255</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"%"</span><span class="p">,</span> <span class="nx">a</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="p">};</span>
|
123
|
+
<span class="p">},</span>
|
124
|
+
<span class="nx">toPercentageRgbString</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
125
|
+
<span class="k">return</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="o">==</span> <span class="mi">1</span><span class="p">)</span> <span class="o">?</span>
|
126
|
+
<span class="s2">"rgb("</span> <span class="o">+</span> <span class="nx">mathRound</span><span class="p">(</span><span class="nx">bound01</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">,</span> <span class="mi">255</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"%, "</span> <span class="o">+</span> <span class="nx">mathRound</span><span class="p">(</span><span class="nx">bound01</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_g</span><span class="p">,</span> <span class="mi">255</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"%, "</span> <span class="o">+</span> <span class="nx">mathRound</span><span class="p">(</span><span class="nx">bound01</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_b</span><span class="p">,</span> <span class="mi">255</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"%)"</span> <span class="o">:</span>
|
127
|
+
<span class="s2">"rgba("</span> <span class="o">+</span> <span class="nx">mathRound</span><span class="p">(</span><span class="nx">bound01</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">,</span> <span class="mi">255</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"%, "</span> <span class="o">+</span> <span class="nx">mathRound</span><span class="p">(</span><span class="nx">bound01</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_g</span><span class="p">,</span> <span class="mi">255</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"%, "</span> <span class="o">+</span> <span class="nx">mathRound</span><span class="p">(</span><span class="nx">bound01</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_b</span><span class="p">,</span> <span class="mi">255</span><span class="p">)</span> <span class="o">*</span> <span class="mi">100</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"%, "</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">_roundA</span> <span class="o">+</span> <span class="s2">")"</span><span class="p">;</span>
|
128
|
+
<span class="p">},</span>
|
129
|
+
<span class="nx">toName</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
130
|
+
<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
|
131
|
+
<span class="k">return</span> <span class="s2">"transparent"</span><span class="p">;</span>
|
132
|
+
<span class="p">}</span>
|
133
|
+
|
134
|
+
<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="o"><</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
|
135
|
+
<span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
|
136
|
+
<span class="p">}</span>
|
137
|
+
|
138
|
+
<span class="k">return</span> <span class="nx">hexNames</span><span class="p">[</span><span class="nx">rgbToHex</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_g</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_b</span><span class="p">,</span> <span class="kc">true</span><span class="p">)]</span> <span class="o">||</span> <span class="kc">false</span><span class="p">;</span>
|
139
|
+
<span class="p">},</span>
|
140
|
+
<span class="nx">toFilter</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">secondColor</span><span class="p">)</span> <span class="p">{</span>
|
141
|
+
<span class="kd">var</span> <span class="nx">hex8String</span> <span class="o">=</span> <span class="s1">'#'</span> <span class="o">+</span> <span class="nx">rgbaToArgbHex</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_g</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_b</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_a</span><span class="p">);</span>
|
142
|
+
<span class="kd">var</span> <span class="nx">secondHex8String</span> <span class="o">=</span> <span class="nx">hex8String</span><span class="p">;</span>
|
143
|
+
<span class="kd">var</span> <span class="nx">gradientType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_gradientType</span> <span class="o">?</span> <span class="s2">"GradientType = 1, "</span> <span class="o">:</span> <span class="s2">""</span><span class="p">;</span>
|
144
|
+
|
145
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">secondColor</span><span class="p">)</span> <span class="p">{</span>
|
146
|
+
<span class="kd">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">secondColor</span><span class="p">);</span>
|
147
|
+
<span class="nx">secondHex8String</span> <span class="o">=</span> <span class="s1">'#'</span> <span class="o">+</span> <span class="nx">rgbaToArgbHex</span><span class="p">(</span><span class="nx">s</span><span class="p">.</span><span class="nx">_r</span><span class="p">,</span> <span class="nx">s</span><span class="p">.</span><span class="nx">_g</span><span class="p">,</span> <span class="nx">s</span><span class="p">.</span><span class="nx">_b</span><span class="p">,</span> <span class="nx">s</span><span class="p">.</span><span class="nx">_a</span><span class="p">);</span>
|
148
|
+
<span class="p">}</span>
|
149
|
+
|
150
|
+
<span class="k">return</span> <span class="s2">"progid:DXImageTransform.Microsoft.gradient("</span><span class="o">+</span><span class="nx">gradientType</span><span class="o">+</span><span class="s2">"startColorstr="</span><span class="o">+</span><span class="nx">hex8String</span><span class="o">+</span><span class="s2">",endColorstr="</span><span class="o">+</span><span class="nx">secondHex8String</span><span class="o">+</span><span class="s2">")"</span><span class="p">;</span>
|
151
|
+
<span class="p">},</span>
|
152
|
+
<span class="nx">toString</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">format</span><span class="p">)</span> <span class="p">{</span>
|
153
|
+
<span class="kd">var</span> <span class="nx">formatSet</span> <span class="o">=</span> <span class="o">!!</span><span class="nx">format</span><span class="p">;</span>
|
154
|
+
<span class="nx">format</span> <span class="o">=</span> <span class="nx">format</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_format</span><span class="p">;</span>
|
155
|
+
|
156
|
+
<span class="kd">var</span> <span class="nx">formattedString</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
|
157
|
+
<span class="kd">var</span> <span class="nx">hasAlpha</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="o"><</span> <span class="mi">1</span> <span class="o">&&</span> <span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="o">>=</span> <span class="mi">0</span><span class="p">;</span>
|
158
|
+
<span class="kd">var</span> <span class="nx">needsAlphaFormat</span> <span class="o">=</span> <span class="o">!</span><span class="nx">formatSet</span> <span class="o">&&</span> <span class="nx">hasAlpha</span> <span class="o">&&</span> <span class="p">(</span><span class="nx">format</span> <span class="o">===</span> <span class="s2">"hex"</span> <span class="o">||</span> <span class="nx">format</span> <span class="o">===</span> <span class="s2">"hex6"</span> <span class="o">||</span> <span class="nx">format</span> <span class="o">===</span> <span class="s2">"hex3"</span> <span class="o">||</span> <span class="nx">format</span> <span class="o">===</span> <span class="s2">"hex4"</span> <span class="o">||</span> <span class="nx">format</span> <span class="o">===</span> <span class="s2">"hex8"</span> <span class="o">||</span> <span class="nx">format</span> <span class="o">===</span> <span class="s2">"name"</span><span class="p">);</span>
|
159
|
+
|
160
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">needsAlphaFormat</span><span class="p">)</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">¶</a> </div> <p>Special case for "transparent", all other non-alpha formats
|
161
|
+
will return rgba when there is transparency.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="nx">format</span> <span class="o">===</span> <span class="s2">"name"</span> <span class="o">&&</span> <span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
|
162
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">toName</span><span class="p">();</span>
|
163
|
+
<span class="p">}</span>
|
164
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">toRgbString</span><span class="p">();</span>
|
165
|
+
<span class="p">}</span>
|
166
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">format</span> <span class="o">===</span> <span class="s2">"rgb"</span><span class="p">)</span> <span class="p">{</span>
|
167
|
+
<span class="nx">formattedString</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toRgbString</span><span class="p">();</span>
|
168
|
+
<span class="p">}</span>
|
169
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">format</span> <span class="o">===</span> <span class="s2">"prgb"</span><span class="p">)</span> <span class="p">{</span>
|
170
|
+
<span class="nx">formattedString</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toPercentageRgbString</span><span class="p">();</span>
|
171
|
+
<span class="p">}</span>
|
172
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">format</span> <span class="o">===</span> <span class="s2">"hex"</span> <span class="o">||</span> <span class="nx">format</span> <span class="o">===</span> <span class="s2">"hex6"</span><span class="p">)</span> <span class="p">{</span>
|
173
|
+
<span class="nx">formattedString</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toHexString</span><span class="p">();</span>
|
174
|
+
<span class="p">}</span>
|
175
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">format</span> <span class="o">===</span> <span class="s2">"hex3"</span><span class="p">)</span> <span class="p">{</span>
|
176
|
+
<span class="nx">formattedString</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toHexString</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
|
177
|
+
<span class="p">}</span>
|
178
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">format</span> <span class="o">===</span> <span class="s2">"hex4"</span><span class="p">)</span> <span class="p">{</span>
|
179
|
+
<span class="nx">formattedString</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toHex8String</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
|
180
|
+
<span class="p">}</span>
|
181
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">format</span> <span class="o">===</span> <span class="s2">"hex8"</span><span class="p">)</span> <span class="p">{</span>
|
182
|
+
<span class="nx">formattedString</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toHex8String</span><span class="p">();</span>
|
183
|
+
<span class="p">}</span>
|
184
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">format</span> <span class="o">===</span> <span class="s2">"name"</span><span class="p">)</span> <span class="p">{</span>
|
185
|
+
<span class="nx">formattedString</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toName</span><span class="p">();</span>
|
186
|
+
<span class="p">}</span>
|
187
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">format</span> <span class="o">===</span> <span class="s2">"hsl"</span><span class="p">)</span> <span class="p">{</span>
|
188
|
+
<span class="nx">formattedString</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toHslString</span><span class="p">();</span>
|
189
|
+
<span class="p">}</span>
|
190
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">format</span> <span class="o">===</span> <span class="s2">"hsv"</span><span class="p">)</span> <span class="p">{</span>
|
191
|
+
<span class="nx">formattedString</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toHsvString</span><span class="p">();</span>
|
192
|
+
<span class="p">}</span>
|
193
|
+
|
194
|
+
<span class="k">return</span> <span class="nx">formattedString</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">toHexString</span><span class="p">();</span>
|
195
|
+
<span class="p">},</span>
|
196
|
+
<span class="nx">clone</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
197
|
+
<span class="k">return</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
|
198
|
+
<span class="p">},</span>
|
199
|
+
|
200
|
+
<span class="nx">_applyModification</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
|
201
|
+
<span class="kd">var</span> <span class="nx">color</span> <span class="o">=</span> <span class="nx">fn</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span> <span class="p">[</span><span class="k">this</span><span class="p">].</span><span class="nx">concat</span><span class="p">([].</span><span class="nx">slice</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">args</span><span class="p">)));</span>
|
202
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">_r</span> <span class="o">=</span> <span class="nx">color</span><span class="p">.</span><span class="nx">_r</span><span class="p">;</span>
|
203
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">_g</span> <span class="o">=</span> <span class="nx">color</span><span class="p">.</span><span class="nx">_g</span><span class="p">;</span>
|
204
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">_b</span> <span class="o">=</span> <span class="nx">color</span><span class="p">.</span><span class="nx">_b</span><span class="p">;</span>
|
205
|
+
<span class="k">this</span><span class="p">.</span><span class="nx">setAlpha</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">_a</span><span class="p">);</span>
|
206
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">;</span>
|
207
|
+
<span class="p">},</span>
|
208
|
+
<span class="nx">lighten</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
209
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_applyModification</span><span class="p">(</span><span class="nx">lighten</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
|
210
|
+
<span class="p">},</span>
|
211
|
+
<span class="nx">brighten</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
212
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_applyModification</span><span class="p">(</span><span class="nx">brighten</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
|
213
|
+
<span class="p">},</span>
|
214
|
+
<span class="nx">darken</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
215
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_applyModification</span><span class="p">(</span><span class="nx">darken</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
|
216
|
+
<span class="p">},</span>
|
217
|
+
<span class="nx">desaturate</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
218
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_applyModification</span><span class="p">(</span><span class="nx">desaturate</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
|
219
|
+
<span class="p">},</span>
|
220
|
+
<span class="nx">saturate</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
221
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_applyModification</span><span class="p">(</span><span class="nx">saturate</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
|
222
|
+
<span class="p">},</span>
|
223
|
+
<span class="nx">greyscale</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
224
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_applyModification</span><span class="p">(</span><span class="nx">greyscale</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
|
225
|
+
<span class="p">},</span>
|
226
|
+
<span class="nx">spin</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
227
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_applyModification</span><span class="p">(</span><span class="nx">spin</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
|
228
|
+
<span class="p">},</span>
|
229
|
+
|
230
|
+
<span class="nx">_applyCombination</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
|
231
|
+
<span class="k">return</span> <span class="nx">fn</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span> <span class="p">[</span><span class="k">this</span><span class="p">].</span><span class="nx">concat</span><span class="p">([].</span><span class="nx">slice</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">args</span><span class="p">)));</span>
|
232
|
+
<span class="p">},</span>
|
233
|
+
<span class="nx">analogous</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
234
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_applyCombination</span><span class="p">(</span><span class="nx">analogous</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
|
235
|
+
<span class="p">},</span>
|
236
|
+
<span class="nx">complement</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
237
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_applyCombination</span><span class="p">(</span><span class="nx">complement</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
|
238
|
+
<span class="p">},</span>
|
239
|
+
<span class="nx">monochromatic</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
240
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_applyCombination</span><span class="p">(</span><span class="nx">monochromatic</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
|
241
|
+
<span class="p">},</span>
|
242
|
+
<span class="nx">splitcomplement</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
243
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_applyCombination</span><span class="p">(</span><span class="nx">splitcomplement</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
|
244
|
+
<span class="p">},</span>
|
245
|
+
<span class="nx">triad</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
246
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_applyCombination</span><span class="p">(</span><span class="nx">triad</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
|
247
|
+
<span class="p">},</span>
|
248
|
+
<span class="nx">tetrad</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
249
|
+
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_applyCombination</span><span class="p">(</span><span class="nx">tetrad</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
|
250
|
+
<span class="p">}</span>
|
251
|
+
<span class="p">};</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">¶</a> </div> <p>If input is an object, force 1 into "1.0" to handle ratios properly
|
252
|
+
String input requires "1.0" as input, so 1 will be treated as 1</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">tinycolor</span><span class="p">.</span><span class="nx">fromRatio</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">color</span><span class="p">,</span> <span class="nx">opts</span><span class="p">)</span> <span class="p">{</span>
|
253
|
+
<span class="k">if</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">color</span> <span class="o">==</span> <span class="s2">"object"</span><span class="p">)</span> <span class="p">{</span>
|
254
|
+
<span class="kd">var</span> <span class="nx">newColor</span> <span class="o">=</span> <span class="p">{};</span>
|
255
|
+
<span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">color</span><span class="p">)</span> <span class="p">{</span>
|
256
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
|
257
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">i</span> <span class="o">===</span> <span class="s2">"a"</span><span class="p">)</span> <span class="p">{</span>
|
258
|
+
<span class="nx">newColor</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="nx">color</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
|
259
|
+
<span class="p">}</span>
|
260
|
+
<span class="k">else</span> <span class="p">{</span>
|
261
|
+
<span class="nx">newColor</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="nx">convertToPercentage</span><span class="p">(</span><span class="nx">color</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
|
262
|
+
<span class="p">}</span>
|
263
|
+
<span class="p">}</span>
|
264
|
+
<span class="p">}</span>
|
265
|
+
<span class="nx">color</span> <span class="o">=</span> <span class="nx">newColor</span><span class="p">;</span>
|
266
|
+
<span class="p">}</span>
|
267
|
+
|
268
|
+
<span class="k">return</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">,</span> <span class="nx">opts</span><span class="p">);</span>
|
269
|
+
<span class="p">};</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">¶</a> </div> <p>Given a string or object, convert that input to RGB
|
270
|
+
Possible string inputs:</p>
|
271
|
+
|
272
|
+
<pre><code>"red"
|
273
|
+
"#f00" or "f00"
|
274
|
+
"#ff0000" or "ff0000"
|
275
|
+
"#ff000000" or "ff000000"
|
276
|
+
"rgb 255 0 0" or "rgb (255, 0, 0)"
|
277
|
+
"rgb 1.0 0 0" or "rgb (1, 0, 0)"
|
278
|
+
"rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
|
279
|
+
"rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
|
280
|
+
"hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
|
281
|
+
"hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
|
282
|
+
"hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
|
283
|
+
</code></pre> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">inputToRGB</span><span class="p">(</span><span class="nx">color</span><span class="p">)</span> <span class="p">{</span>
|
284
|
+
|
285
|
+
<span class="kd">var</span> <span class="nx">rgb</span> <span class="o">=</span> <span class="p">{</span> <span class="nx">r</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">g</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">b</span><span class="o">:</span> <span class="mi">0</span> <span class="p">};</span>
|
286
|
+
<span class="kd">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
|
287
|
+
<span class="kd">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
|
288
|
+
<span class="kd">var</span> <span class="nx">v</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
|
289
|
+
<span class="kd">var</span> <span class="nx">l</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
|
290
|
+
<span class="kd">var</span> <span class="nx">ok</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
|
291
|
+
<span class="kd">var</span> <span class="nx">format</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
|
292
|
+
|
293
|
+
<span class="k">if</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">color</span> <span class="o">==</span> <span class="s2">"string"</span><span class="p">)</span> <span class="p">{</span>
|
294
|
+
<span class="nx">color</span> <span class="o">=</span> <span class="nx">stringInputToObject</span><span class="p">(</span><span class="nx">color</span><span class="p">);</span>
|
295
|
+
<span class="p">}</span>
|
296
|
+
|
297
|
+
<span class="k">if</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">color</span> <span class="o">==</span> <span class="s2">"object"</span><span class="p">)</span> <span class="p">{</span>
|
298
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">isValidCSSUnit</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">r</span><span class="p">)</span> <span class="o">&&</span> <span class="nx">isValidCSSUnit</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">g</span><span class="p">)</span> <span class="o">&&</span> <span class="nx">isValidCSSUnit</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">b</span><span class="p">))</span> <span class="p">{</span>
|
299
|
+
<span class="nx">rgb</span> <span class="o">=</span> <span class="nx">rgbToRgb</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">r</span><span class="p">,</span> <span class="nx">color</span><span class="p">.</span><span class="nx">g</span><span class="p">,</span> <span class="nx">color</span><span class="p">.</span><span class="nx">b</span><span class="p">);</span>
|
300
|
+
<span class="nx">ok</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
|
301
|
+
<span class="nx">format</span> <span class="o">=</span> <span class="nb">String</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">r</span><span class="p">).</span><span class="nx">substr</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">===</span> <span class="s2">"%"</span> <span class="o">?</span> <span class="s2">"prgb"</span> <span class="o">:</span> <span class="s2">"rgb"</span><span class="p">;</span>
|
302
|
+
<span class="p">}</span>
|
303
|
+
<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">isValidCSSUnit</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">h</span><span class="p">)</span> <span class="o">&&</span> <span class="nx">isValidCSSUnit</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">s</span><span class="p">)</span> <span class="o">&&</span> <span class="nx">isValidCSSUnit</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">v</span><span class="p">))</span> <span class="p">{</span>
|
304
|
+
<span class="nx">s</span> <span class="o">=</span> <span class="nx">convertToPercentage</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">s</span><span class="p">);</span>
|
305
|
+
<span class="nx">v</span> <span class="o">=</span> <span class="nx">convertToPercentage</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">v</span><span class="p">);</span>
|
306
|
+
<span class="nx">rgb</span> <span class="o">=</span> <span class="nx">hsvToRgb</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">h</span><span class="p">,</span> <span class="nx">s</span><span class="p">,</span> <span class="nx">v</span><span class="p">);</span>
|
307
|
+
<span class="nx">ok</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
|
308
|
+
<span class="nx">format</span> <span class="o">=</span> <span class="s2">"hsv"</span><span class="p">;</span>
|
309
|
+
<span class="p">}</span>
|
310
|
+
<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">isValidCSSUnit</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">h</span><span class="p">)</span> <span class="o">&&</span> <span class="nx">isValidCSSUnit</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">s</span><span class="p">)</span> <span class="o">&&</span> <span class="nx">isValidCSSUnit</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">l</span><span class="p">))</span> <span class="p">{</span>
|
311
|
+
<span class="nx">s</span> <span class="o">=</span> <span class="nx">convertToPercentage</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">s</span><span class="p">);</span>
|
312
|
+
<span class="nx">l</span> <span class="o">=</span> <span class="nx">convertToPercentage</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">l</span><span class="p">);</span>
|
313
|
+
<span class="nx">rgb</span> <span class="o">=</span> <span class="nx">hslToRgb</span><span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">h</span><span class="p">,</span> <span class="nx">s</span><span class="p">,</span> <span class="nx">l</span><span class="p">);</span>
|
314
|
+
<span class="nx">ok</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
|
315
|
+
<span class="nx">format</span> <span class="o">=</span> <span class="s2">"hsl"</span><span class="p">;</span>
|
316
|
+
<span class="p">}</span>
|
317
|
+
|
318
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">color</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="s2">"a"</span><span class="p">))</span> <span class="p">{</span>
|
319
|
+
<span class="nx">a</span> <span class="o">=</span> <span class="nx">color</span><span class="p">.</span><span class="nx">a</span><span class="p">;</span>
|
320
|
+
<span class="p">}</span>
|
321
|
+
<span class="p">}</span>
|
322
|
+
|
323
|
+
<span class="nx">a</span> <span class="o">=</span> <span class="nx">boundAlpha</span><span class="p">(</span><span class="nx">a</span><span class="p">);</span>
|
324
|
+
|
325
|
+
<span class="k">return</span> <span class="p">{</span>
|
326
|
+
<span class="nx">ok</span><span class="o">:</span> <span class="nx">ok</span><span class="p">,</span>
|
327
|
+
<span class="nx">format</span><span class="o">:</span> <span class="nx">color</span><span class="p">.</span><span class="nx">format</span> <span class="o">||</span> <span class="nx">format</span><span class="p">,</span>
|
328
|
+
<span class="nx">r</span><span class="o">:</span> <span class="nx">mathMin</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="nx">mathMax</span><span class="p">(</span><span class="nx">rgb</span><span class="p">.</span><span class="nx">r</span><span class="p">,</span> <span class="mi">0</span><span class="p">)),</span>
|
329
|
+
<span class="nx">g</span><span class="o">:</span> <span class="nx">mathMin</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="nx">mathMax</span><span class="p">(</span><span class="nx">rgb</span><span class="p">.</span><span class="nx">g</span><span class="p">,</span> <span class="mi">0</span><span class="p">)),</span>
|
330
|
+
<span class="nx">b</span><span class="o">:</span> <span class="nx">mathMin</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="nx">mathMax</span><span class="p">(</span><span class="nx">rgb</span><span class="p">.</span><span class="nx">b</span><span class="p">,</span> <span class="mi">0</span><span class="p">)),</span>
|
331
|
+
<span class="nx">a</span><span class="o">:</span> <span class="nx">a</span>
|
332
|
+
<span class="p">};</span>
|
333
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">¶</a> </div> <h2>Conversion Functions</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-11">¶</a> </div> <p><code>rgbToHsl</code>, <code>rgbToHsv</code>, <code>hslToRgb</code>, <code>hsvToRgb</code> modified from:
|
334
|
+
<a href="http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript">http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript</a></p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-12"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-12">¶</a> </div> <p><code>rgbToRgb</code>
|
335
|
+
Handle bounds / percentage checking to conform to CSS color spec
|
336
|
+
<a href="http://www.w3.org/TR/css3-color/">http://www.w3.org/TR/css3-color/</a>
|
337
|
+
<em>Assumes:</em> r, g, b in [0, 255] or [0, 1]
|
338
|
+
<em>Returns:</em> { r, g, b } in [0, 255]</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">rgbToRgb</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="nx">g</span><span class="p">,</span> <span class="nx">b</span><span class="p">){</span>
|
339
|
+
<span class="k">return</span> <span class="p">{</span>
|
340
|
+
<span class="nx">r</span><span class="o">:</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="mi">255</span><span class="p">)</span> <span class="o">*</span> <span class="mi">255</span><span class="p">,</span>
|
341
|
+
<span class="nx">g</span><span class="o">:</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">g</span><span class="p">,</span> <span class="mi">255</span><span class="p">)</span> <span class="o">*</span> <span class="mi">255</span><span class="p">,</span>
|
342
|
+
<span class="nx">b</span><span class="o">:</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">b</span><span class="p">,</span> <span class="mi">255</span><span class="p">)</span> <span class="o">*</span> <span class="mi">255</span>
|
343
|
+
<span class="p">};</span>
|
344
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-13"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-13">¶</a> </div> <p><code>rgbToHsl</code>
|
345
|
+
Converts an RGB color value to HSL.
|
346
|
+
<em>Assumes:</em> r, g, and b are contained in [0, 255] or [0, 1]
|
347
|
+
<em>Returns:</em> { h, s, l } in [0,1]</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">rgbToHsl</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="nx">g</span><span class="p">,</span> <span class="nx">b</span><span class="p">)</span> <span class="p">{</span>
|
348
|
+
|
349
|
+
<span class="nx">r</span> <span class="o">=</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="mi">255</span><span class="p">);</span>
|
350
|
+
<span class="nx">g</span> <span class="o">=</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">g</span><span class="p">,</span> <span class="mi">255</span><span class="p">);</span>
|
351
|
+
<span class="nx">b</span> <span class="o">=</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">b</span><span class="p">,</span> <span class="mi">255</span><span class="p">);</span>
|
352
|
+
|
353
|
+
<span class="kd">var</span> <span class="nx">max</span> <span class="o">=</span> <span class="nx">mathMax</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="nx">g</span><span class="p">,</span> <span class="nx">b</span><span class="p">),</span> <span class="nx">min</span> <span class="o">=</span> <span class="nx">mathMin</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="nx">g</span><span class="p">,</span> <span class="nx">b</span><span class="p">);</span>
|
354
|
+
<span class="kd">var</span> <span class="nx">h</span><span class="p">,</span> <span class="nx">s</span><span class="p">,</span> <span class="nx">l</span> <span class="o">=</span> <span class="p">(</span><span class="nx">max</span> <span class="o">+</span> <span class="nx">min</span><span class="p">)</span> <span class="o">/</span> <span class="mi">2</span><span class="p">;</span>
|
355
|
+
|
356
|
+
<span class="k">if</span><span class="p">(</span><span class="nx">max</span> <span class="o">==</span> <span class="nx">min</span><span class="p">)</span> <span class="p">{</span>
|
357
|
+
<span class="nx">h</span> <span class="o">=</span> <span class="nx">s</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="c1">// achromatic</span>
|
358
|
+
<span class="p">}</span>
|
359
|
+
<span class="k">else</span> <span class="p">{</span>
|
360
|
+
<span class="kd">var</span> <span class="nx">d</span> <span class="o">=</span> <span class="nx">max</span> <span class="o">-</span> <span class="nx">min</span><span class="p">;</span>
|
361
|
+
<span class="nx">s</span> <span class="o">=</span> <span class="nx">l</span> <span class="o">></span> <span class="mf">0.5</span> <span class="o">?</span> <span class="nx">d</span> <span class="o">/</span> <span class="p">(</span><span class="mi">2</span> <span class="o">-</span> <span class="nx">max</span> <span class="o">-</span> <span class="nx">min</span><span class="p">)</span> <span class="o">:</span> <span class="nx">d</span> <span class="o">/</span> <span class="p">(</span><span class="nx">max</span> <span class="o">+</span> <span class="nx">min</span><span class="p">);</span>
|
362
|
+
<span class="k">switch</span><span class="p">(</span><span class="nx">max</span><span class="p">)</span> <span class="p">{</span>
|
363
|
+
<span class="k">case</span> <span class="nx">r</span><span class="o">:</span> <span class="nx">h</span> <span class="o">=</span> <span class="p">(</span><span class="nx">g</span> <span class="o">-</span> <span class="nx">b</span><span class="p">)</span> <span class="o">/</span> <span class="nx">d</span> <span class="o">+</span> <span class="p">(</span><span class="nx">g</span> <span class="o"><</span> <span class="nx">b</span> <span class="o">?</span> <span class="mi">6</span> <span class="o">:</span> <span class="mi">0</span><span class="p">);</span> <span class="k">break</span><span class="p">;</span>
|
364
|
+
<span class="k">case</span> <span class="nx">g</span><span class="o">:</span> <span class="nx">h</span> <span class="o">=</span> <span class="p">(</span><span class="nx">b</span> <span class="o">-</span> <span class="nx">r</span><span class="p">)</span> <span class="o">/</span> <span class="nx">d</span> <span class="o">+</span> <span class="mi">2</span><span class="p">;</span> <span class="k">break</span><span class="p">;</span>
|
365
|
+
<span class="k">case</span> <span class="nx">b</span><span class="o">:</span> <span class="nx">h</span> <span class="o">=</span> <span class="p">(</span><span class="nx">r</span> <span class="o">-</span> <span class="nx">g</span><span class="p">)</span> <span class="o">/</span> <span class="nx">d</span> <span class="o">+</span> <span class="mi">4</span><span class="p">;</span> <span class="k">break</span><span class="p">;</span>
|
366
|
+
<span class="p">}</span>
|
367
|
+
|
368
|
+
<span class="nx">h</span> <span class="o">/=</span> <span class="mi">6</span><span class="p">;</span>
|
369
|
+
<span class="p">}</span>
|
370
|
+
|
371
|
+
<span class="k">return</span> <span class="p">{</span> <span class="nx">h</span><span class="o">:</span> <span class="nx">h</span><span class="p">,</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">s</span><span class="p">,</span> <span class="nx">l</span><span class="o">:</span> <span class="nx">l</span> <span class="p">};</span>
|
372
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-14"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-14">¶</a> </div> <p><code>hslToRgb</code>
|
373
|
+
Converts an HSL color value to RGB.
|
374
|
+
<em>Assumes:</em> h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
|
375
|
+
<em>Returns:</em> { r, g, b } in the set [0, 255]</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">hslToRgb</span><span class="p">(</span><span class="nx">h</span><span class="p">,</span> <span class="nx">s</span><span class="p">,</span> <span class="nx">l</span><span class="p">)</span> <span class="p">{</span>
|
376
|
+
<span class="kd">var</span> <span class="nx">r</span><span class="p">,</span> <span class="nx">g</span><span class="p">,</span> <span class="nx">b</span><span class="p">;</span>
|
377
|
+
|
378
|
+
<span class="nx">h</span> <span class="o">=</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">h</span><span class="p">,</span> <span class="mi">360</span><span class="p">);</span>
|
379
|
+
<span class="nx">s</span> <span class="o">=</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">s</span><span class="p">,</span> <span class="mi">100</span><span class="p">);</span>
|
380
|
+
<span class="nx">l</span> <span class="o">=</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">l</span><span class="p">,</span> <span class="mi">100</span><span class="p">);</span>
|
381
|
+
|
382
|
+
<span class="kd">function</span> <span class="nx">hue2rgb</span><span class="p">(</span><span class="nx">p</span><span class="p">,</span> <span class="nx">q</span><span class="p">,</span> <span class="nx">t</span><span class="p">)</span> <span class="p">{</span>
|
383
|
+
<span class="k">if</span><span class="p">(</span><span class="nx">t</span> <span class="o"><</span> <span class="mi">0</span><span class="p">)</span> <span class="nx">t</span> <span class="o">+=</span> <span class="mi">1</span><span class="p">;</span>
|
384
|
+
<span class="k">if</span><span class="p">(</span><span class="nx">t</span> <span class="o">></span> <span class="mi">1</span><span class="p">)</span> <span class="nx">t</span> <span class="o">-=</span> <span class="mi">1</span><span class="p">;</span>
|
385
|
+
<span class="k">if</span><span class="p">(</span><span class="nx">t</span> <span class="o"><</span> <span class="mi">1</span><span class="o">/</span><span class="mi">6</span><span class="p">)</span> <span class="k">return</span> <span class="nx">p</span> <span class="o">+</span> <span class="p">(</span><span class="nx">q</span> <span class="o">-</span> <span class="nx">p</span><span class="p">)</span> <span class="o">*</span> <span class="mi">6</span> <span class="o">*</span> <span class="nx">t</span><span class="p">;</span>
|
386
|
+
<span class="k">if</span><span class="p">(</span><span class="nx">t</span> <span class="o"><</span> <span class="mi">1</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span> <span class="k">return</span> <span class="nx">q</span><span class="p">;</span>
|
387
|
+
<span class="k">if</span><span class="p">(</span><span class="nx">t</span> <span class="o"><</span> <span class="mi">2</span><span class="o">/</span><span class="mi">3</span><span class="p">)</span> <span class="k">return</span> <span class="nx">p</span> <span class="o">+</span> <span class="p">(</span><span class="nx">q</span> <span class="o">-</span> <span class="nx">p</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="mi">2</span><span class="o">/</span><span class="mi">3</span> <span class="o">-</span> <span class="nx">t</span><span class="p">)</span> <span class="o">*</span> <span class="mi">6</span><span class="p">;</span>
|
388
|
+
<span class="k">return</span> <span class="nx">p</span><span class="p">;</span>
|
389
|
+
<span class="p">}</span>
|
390
|
+
|
391
|
+
<span class="k">if</span><span class="p">(</span><span class="nx">s</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
|
392
|
+
<span class="nx">r</span> <span class="o">=</span> <span class="nx">g</span> <span class="o">=</span> <span class="nx">b</span> <span class="o">=</span> <span class="nx">l</span><span class="p">;</span> <span class="c1">// achromatic</span>
|
393
|
+
<span class="p">}</span>
|
394
|
+
<span class="k">else</span> <span class="p">{</span>
|
395
|
+
<span class="kd">var</span> <span class="nx">q</span> <span class="o">=</span> <span class="nx">l</span> <span class="o"><</span> <span class="mf">0.5</span> <span class="o">?</span> <span class="nx">l</span> <span class="o">*</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="nx">s</span><span class="p">)</span> <span class="o">:</span> <span class="nx">l</span> <span class="o">+</span> <span class="nx">s</span> <span class="o">-</span> <span class="nx">l</span> <span class="o">*</span> <span class="nx">s</span><span class="p">;</span>
|
396
|
+
<span class="kd">var</span> <span class="nx">p</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">*</span> <span class="nx">l</span> <span class="o">-</span> <span class="nx">q</span><span class="p">;</span>
|
397
|
+
<span class="nx">r</span> <span class="o">=</span> <span class="nx">hue2rgb</span><span class="p">(</span><span class="nx">p</span><span class="p">,</span> <span class="nx">q</span><span class="p">,</span> <span class="nx">h</span> <span class="o">+</span> <span class="mi">1</span><span class="o">/</span><span class="mi">3</span><span class="p">);</span>
|
398
|
+
<span class="nx">g</span> <span class="o">=</span> <span class="nx">hue2rgb</span><span class="p">(</span><span class="nx">p</span><span class="p">,</span> <span class="nx">q</span><span class="p">,</span> <span class="nx">h</span><span class="p">);</span>
|
399
|
+
<span class="nx">b</span> <span class="o">=</span> <span class="nx">hue2rgb</span><span class="p">(</span><span class="nx">p</span><span class="p">,</span> <span class="nx">q</span><span class="p">,</span> <span class="nx">h</span> <span class="o">-</span> <span class="mi">1</span><span class="o">/</span><span class="mi">3</span><span class="p">);</span>
|
400
|
+
<span class="p">}</span>
|
401
|
+
|
402
|
+
<span class="k">return</span> <span class="p">{</span> <span class="nx">r</span><span class="o">:</span> <span class="nx">r</span> <span class="o">*</span> <span class="mi">255</span><span class="p">,</span> <span class="nx">g</span><span class="o">:</span> <span class="nx">g</span> <span class="o">*</span> <span class="mi">255</span><span class="p">,</span> <span class="nx">b</span><span class="o">:</span> <span class="nx">b</span> <span class="o">*</span> <span class="mi">255</span> <span class="p">};</span>
|
403
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-15"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-15">¶</a> </div> <p><code>rgbToHsv</code>
|
404
|
+
Converts an RGB color value to HSV
|
405
|
+
<em>Assumes:</em> r, g, and b are contained in the set [0, 255] or [0, 1]
|
406
|
+
<em>Returns:</em> { h, s, v } in [0,1]</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">rgbToHsv</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="nx">g</span><span class="p">,</span> <span class="nx">b</span><span class="p">)</span> <span class="p">{</span>
|
407
|
+
|
408
|
+
<span class="nx">r</span> <span class="o">=</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="mi">255</span><span class="p">);</span>
|
409
|
+
<span class="nx">g</span> <span class="o">=</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">g</span><span class="p">,</span> <span class="mi">255</span><span class="p">);</span>
|
410
|
+
<span class="nx">b</span> <span class="o">=</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">b</span><span class="p">,</span> <span class="mi">255</span><span class="p">);</span>
|
411
|
+
|
412
|
+
<span class="kd">var</span> <span class="nx">max</span> <span class="o">=</span> <span class="nx">mathMax</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="nx">g</span><span class="p">,</span> <span class="nx">b</span><span class="p">),</span> <span class="nx">min</span> <span class="o">=</span> <span class="nx">mathMin</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="nx">g</span><span class="p">,</span> <span class="nx">b</span><span class="p">);</span>
|
413
|
+
<span class="kd">var</span> <span class="nx">h</span><span class="p">,</span> <span class="nx">s</span><span class="p">,</span> <span class="nx">v</span> <span class="o">=</span> <span class="nx">max</span><span class="p">;</span>
|
414
|
+
|
415
|
+
<span class="kd">var</span> <span class="nx">d</span> <span class="o">=</span> <span class="nx">max</span> <span class="o">-</span> <span class="nx">min</span><span class="p">;</span>
|
416
|
+
<span class="nx">s</span> <span class="o">=</span> <span class="nx">max</span> <span class="o">===</span> <span class="mi">0</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="nx">d</span> <span class="o">/</span> <span class="nx">max</span><span class="p">;</span>
|
417
|
+
|
418
|
+
<span class="k">if</span><span class="p">(</span><span class="nx">max</span> <span class="o">==</span> <span class="nx">min</span><span class="p">)</span> <span class="p">{</span>
|
419
|
+
<span class="nx">h</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="c1">// achromatic</span>
|
420
|
+
<span class="p">}</span>
|
421
|
+
<span class="k">else</span> <span class="p">{</span>
|
422
|
+
<span class="k">switch</span><span class="p">(</span><span class="nx">max</span><span class="p">)</span> <span class="p">{</span>
|
423
|
+
<span class="k">case</span> <span class="nx">r</span><span class="o">:</span> <span class="nx">h</span> <span class="o">=</span> <span class="p">(</span><span class="nx">g</span> <span class="o">-</span> <span class="nx">b</span><span class="p">)</span> <span class="o">/</span> <span class="nx">d</span> <span class="o">+</span> <span class="p">(</span><span class="nx">g</span> <span class="o"><</span> <span class="nx">b</span> <span class="o">?</span> <span class="mi">6</span> <span class="o">:</span> <span class="mi">0</span><span class="p">);</span> <span class="k">break</span><span class="p">;</span>
|
424
|
+
<span class="k">case</span> <span class="nx">g</span><span class="o">:</span> <span class="nx">h</span> <span class="o">=</span> <span class="p">(</span><span class="nx">b</span> <span class="o">-</span> <span class="nx">r</span><span class="p">)</span> <span class="o">/</span> <span class="nx">d</span> <span class="o">+</span> <span class="mi">2</span><span class="p">;</span> <span class="k">break</span><span class="p">;</span>
|
425
|
+
<span class="k">case</span> <span class="nx">b</span><span class="o">:</span> <span class="nx">h</span> <span class="o">=</span> <span class="p">(</span><span class="nx">r</span> <span class="o">-</span> <span class="nx">g</span><span class="p">)</span> <span class="o">/</span> <span class="nx">d</span> <span class="o">+</span> <span class="mi">4</span><span class="p">;</span> <span class="k">break</span><span class="p">;</span>
|
426
|
+
<span class="p">}</span>
|
427
|
+
<span class="nx">h</span> <span class="o">/=</span> <span class="mi">6</span><span class="p">;</span>
|
428
|
+
<span class="p">}</span>
|
429
|
+
<span class="k">return</span> <span class="p">{</span> <span class="nx">h</span><span class="o">:</span> <span class="nx">h</span><span class="p">,</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">s</span><span class="p">,</span> <span class="nx">v</span><span class="o">:</span> <span class="nx">v</span> <span class="p">};</span>
|
430
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-16"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-16">¶</a> </div> <p><code>hsvToRgb</code>
|
431
|
+
Converts an HSV color value to RGB.
|
432
|
+
<em>Assumes:</em> h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
|
433
|
+
<em>Returns:</em> { r, g, b } in the set [0, 255]</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">function</span> <span class="nx">hsvToRgb</span><span class="p">(</span><span class="nx">h</span><span class="p">,</span> <span class="nx">s</span><span class="p">,</span> <span class="nx">v</span><span class="p">)</span> <span class="p">{</span>
|
434
|
+
|
435
|
+
<span class="nx">h</span> <span class="o">=</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">h</span><span class="p">,</span> <span class="mi">360</span><span class="p">)</span> <span class="o">*</span> <span class="mi">6</span><span class="p">;</span>
|
436
|
+
<span class="nx">s</span> <span class="o">=</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">s</span><span class="p">,</span> <span class="mi">100</span><span class="p">);</span>
|
437
|
+
<span class="nx">v</span> <span class="o">=</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">v</span><span class="p">,</span> <span class="mi">100</span><span class="p">);</span>
|
438
|
+
|
439
|
+
<span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">floor</span><span class="p">(</span><span class="nx">h</span><span class="p">),</span>
|
440
|
+
<span class="nx">f</span> <span class="o">=</span> <span class="nx">h</span> <span class="o">-</span> <span class="nx">i</span><span class="p">,</span>
|
441
|
+
<span class="nx">p</span> <span class="o">=</span> <span class="nx">v</span> <span class="o">*</span> <span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nx">s</span><span class="p">),</span>
|
442
|
+
<span class="nx">q</span> <span class="o">=</span> <span class="nx">v</span> <span class="o">*</span> <span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nx">f</span> <span class="o">*</span> <span class="nx">s</span><span class="p">),</span>
|
443
|
+
<span class="nx">t</span> <span class="o">=</span> <span class="nx">v</span> <span class="o">*</span> <span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="nx">f</span><span class="p">)</span> <span class="o">*</span> <span class="nx">s</span><span class="p">),</span>
|
444
|
+
<span class="nx">mod</span> <span class="o">=</span> <span class="nx">i</span> <span class="o">%</span> <span class="mi">6</span><span class="p">,</span>
|
445
|
+
<span class="nx">r</span> <span class="o">=</span> <span class="p">[</span><span class="nx">v</span><span class="p">,</span> <span class="nx">q</span><span class="p">,</span> <span class="nx">p</span><span class="p">,</span> <span class="nx">p</span><span class="p">,</span> <span class="nx">t</span><span class="p">,</span> <span class="nx">v</span><span class="p">][</span><span class="nx">mod</span><span class="p">],</span>
|
446
|
+
<span class="nx">g</span> <span class="o">=</span> <span class="p">[</span><span class="nx">t</span><span class="p">,</span> <span class="nx">v</span><span class="p">,</span> <span class="nx">v</span><span class="p">,</span> <span class="nx">q</span><span class="p">,</span> <span class="nx">p</span><span class="p">,</span> <span class="nx">p</span><span class="p">][</span><span class="nx">mod</span><span class="p">],</span>
|
447
|
+
<span class="nx">b</span> <span class="o">=</span> <span class="p">[</span><span class="nx">p</span><span class="p">,</span> <span class="nx">p</span><span class="p">,</span> <span class="nx">t</span><span class="p">,</span> <span class="nx">v</span><span class="p">,</span> <span class="nx">v</span><span class="p">,</span> <span class="nx">q</span><span class="p">][</span><span class="nx">mod</span><span class="p">];</span>
|
448
|
+
|
449
|
+
<span class="k">return</span> <span class="p">{</span> <span class="nx">r</span><span class="o">:</span> <span class="nx">r</span> <span class="o">*</span> <span class="mi">255</span><span class="p">,</span> <span class="nx">g</span><span class="o">:</span> <span class="nx">g</span> <span class="o">*</span> <span class="mi">255</span><span class="p">,</span> <span class="nx">b</span><span class="o">:</span> <span class="nx">b</span> <span class="o">*</span> <span class="mi">255</span> <span class="p">};</span>
|
450
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-17"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-17">¶</a> </div> <p><code>rgbToHex</code>
|
451
|
+
Converts an RGB color to hex
|
452
|
+
Assumes r, g, and b are contained in the set [0, 255]
|
453
|
+
Returns a 3 or 6 character hex</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">rgbToHex</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="nx">g</span><span class="p">,</span> <span class="nx">b</span><span class="p">,</span> <span class="nx">allow3Char</span><span class="p">)</span> <span class="p">{</span>
|
454
|
+
|
455
|
+
<span class="kd">var</span> <span class="nx">hex</span> <span class="o">=</span> <span class="p">[</span>
|
456
|
+
<span class="nx">pad2</span><span class="p">(</span><span class="nx">mathRound</span><span class="p">(</span><span class="nx">r</span><span class="p">).</span><span class="nx">toString</span><span class="p">(</span><span class="mi">16</span><span class="p">)),</span>
|
457
|
+
<span class="nx">pad2</span><span class="p">(</span><span class="nx">mathRound</span><span class="p">(</span><span class="nx">g</span><span class="p">).</span><span class="nx">toString</span><span class="p">(</span><span class="mi">16</span><span class="p">)),</span>
|
458
|
+
<span class="nx">pad2</span><span class="p">(</span><span class="nx">mathRound</span><span class="p">(</span><span class="nx">b</span><span class="p">).</span><span class="nx">toString</span><span class="p">(</span><span class="mi">16</span><span class="p">))</span>
|
459
|
+
<span class="p">];</span></pre></div> </td> </tr> <tr id="section-18"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-18">¶</a> </div> <p>Return a 3 character hex if possible</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="nx">allow3Char</span> <span class="o">&&</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">==</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="o">&&</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">1</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">==</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">1</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="o">&&</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">2</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">==</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">2</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span> <span class="p">{</span>
|
460
|
+
<span class="k">return</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">+</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">1</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">+</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">2</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
|
461
|
+
<span class="p">}</span>
|
462
|
+
|
463
|
+
<span class="k">return</span> <span class="nx">hex</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="s2">""</span><span class="p">);</span>
|
464
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-19"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-19">¶</a> </div> <p><code>rgbaToHex</code>
|
465
|
+
Converts an RGBA color plus alpha transparency to hex
|
466
|
+
Assumes r, g, b are contained in the set [0, 255] and
|
467
|
+
a in [0, 1]. Returns a 4 or 8 character rgba hex</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">rgbaToHex</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="nx">g</span><span class="p">,</span> <span class="nx">b</span><span class="p">,</span> <span class="nx">a</span><span class="p">,</span> <span class="nx">allow4Char</span><span class="p">)</span> <span class="p">{</span>
|
468
|
+
|
469
|
+
<span class="kd">var</span> <span class="nx">hex</span> <span class="o">=</span> <span class="p">[</span>
|
470
|
+
<span class="nx">pad2</span><span class="p">(</span><span class="nx">mathRound</span><span class="p">(</span><span class="nx">r</span><span class="p">).</span><span class="nx">toString</span><span class="p">(</span><span class="mi">16</span><span class="p">)),</span>
|
471
|
+
<span class="nx">pad2</span><span class="p">(</span><span class="nx">mathRound</span><span class="p">(</span><span class="nx">g</span><span class="p">).</span><span class="nx">toString</span><span class="p">(</span><span class="mi">16</span><span class="p">)),</span>
|
472
|
+
<span class="nx">pad2</span><span class="p">(</span><span class="nx">mathRound</span><span class="p">(</span><span class="nx">b</span><span class="p">).</span><span class="nx">toString</span><span class="p">(</span><span class="mi">16</span><span class="p">)),</span>
|
473
|
+
<span class="nx">pad2</span><span class="p">(</span><span class="nx">convertDecimalToHex</span><span class="p">(</span><span class="nx">a</span><span class="p">))</span>
|
474
|
+
<span class="p">];</span></pre></div> </td> </tr> <tr id="section-20"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-20">¶</a> </div> <p>Return a 4 character hex if possible</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="nx">allow4Char</span> <span class="o">&&</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">==</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="o">&&</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">1</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">==</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">1</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="o">&&</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">2</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">==</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">2</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="o">&&</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">3</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">==</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">3</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span> <span class="p">{</span>
|
475
|
+
<span class="k">return</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">+</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">1</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">+</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">2</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">+</span> <span class="nx">hex</span><span class="p">[</span><span class="mi">3</span><span class="p">].</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
|
476
|
+
<span class="p">}</span>
|
477
|
+
|
478
|
+
<span class="k">return</span> <span class="nx">hex</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="s2">""</span><span class="p">);</span>
|
479
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-21"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-21">¶</a> </div> <p><code>rgbaToArgbHex</code>
|
480
|
+
Converts an RGBA color to an ARGB Hex8 string
|
481
|
+
Rarely used, but required for "toFilter()"</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">rgbaToArgbHex</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="nx">g</span><span class="p">,</span> <span class="nx">b</span><span class="p">,</span> <span class="nx">a</span><span class="p">)</span> <span class="p">{</span>
|
482
|
+
|
483
|
+
<span class="kd">var</span> <span class="nx">hex</span> <span class="o">=</span> <span class="p">[</span>
|
484
|
+
<span class="nx">pad2</span><span class="p">(</span><span class="nx">convertDecimalToHex</span><span class="p">(</span><span class="nx">a</span><span class="p">)),</span>
|
485
|
+
<span class="nx">pad2</span><span class="p">(</span><span class="nx">mathRound</span><span class="p">(</span><span class="nx">r</span><span class="p">).</span><span class="nx">toString</span><span class="p">(</span><span class="mi">16</span><span class="p">)),</span>
|
486
|
+
<span class="nx">pad2</span><span class="p">(</span><span class="nx">mathRound</span><span class="p">(</span><span class="nx">g</span><span class="p">).</span><span class="nx">toString</span><span class="p">(</span><span class="mi">16</span><span class="p">)),</span>
|
487
|
+
<span class="nx">pad2</span><span class="p">(</span><span class="nx">mathRound</span><span class="p">(</span><span class="nx">b</span><span class="p">).</span><span class="nx">toString</span><span class="p">(</span><span class="mi">16</span><span class="p">))</span>
|
488
|
+
<span class="p">];</span>
|
489
|
+
|
490
|
+
<span class="k">return</span> <span class="nx">hex</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="s2">""</span><span class="p">);</span>
|
491
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-22"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-22">¶</a> </div> <p><code>equals</code>
|
492
|
+
Can be called with any tinycolor input</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">tinycolor</span><span class="p">.</span><span class="nx">equals</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">color1</span><span class="p">,</span> <span class="nx">color2</span><span class="p">)</span> <span class="p">{</span>
|
493
|
+
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">color1</span> <span class="o">||</span> <span class="o">!</span><span class="nx">color2</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="kc">false</span><span class="p">;</span> <span class="p">}</span>
|
494
|
+
<span class="k">return</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color1</span><span class="p">).</span><span class="nx">toRgbString</span><span class="p">()</span> <span class="o">==</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color2</span><span class="p">).</span><span class="nx">toRgbString</span><span class="p">();</span>
|
495
|
+
<span class="p">};</span>
|
496
|
+
|
497
|
+
<span class="nx">tinycolor</span><span class="p">.</span><span class="nx">random</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
498
|
+
<span class="k">return</span> <span class="nx">tinycolor</span><span class="p">.</span><span class="nx">fromRatio</span><span class="p">({</span>
|
499
|
+
<span class="nx">r</span><span class="o">:</span> <span class="nx">mathRandom</span><span class="p">(),</span>
|
500
|
+
<span class="nx">g</span><span class="o">:</span> <span class="nx">mathRandom</span><span class="p">(),</span>
|
501
|
+
<span class="nx">b</span><span class="o">:</span> <span class="nx">mathRandom</span><span class="p">()</span>
|
502
|
+
<span class="p">});</span>
|
503
|
+
<span class="p">};</span></pre></div> </td> </tr> <tr id="section-23"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-23">¶</a> </div> <h2>Modification Functions</h2>
|
504
|
+
|
505
|
+
<p>Thanks to less.js for some of the basics here
|
506
|
+
<a href="https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js">https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js</a></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">desaturate</span><span class="p">(</span><span class="nx">color</span><span class="p">,</span> <span class="nx">amount</span><span class="p">)</span> <span class="p">{</span>
|
507
|
+
<span class="nx">amount</span> <span class="o">=</span> <span class="p">(</span><span class="nx">amount</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="p">(</span><span class="nx">amount</span> <span class="o">||</span> <span class="mi">10</span><span class="p">);</span>
|
508
|
+
<span class="kd">var</span> <span class="nx">hsl</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">).</span><span class="nx">toHsl</span><span class="p">();</span>
|
509
|
+
<span class="nx">hsl</span><span class="p">.</span><span class="nx">s</span> <span class="o">-=</span> <span class="nx">amount</span> <span class="o">/</span> <span class="mi">100</span><span class="p">;</span>
|
510
|
+
<span class="nx">hsl</span><span class="p">.</span><span class="nx">s</span> <span class="o">=</span> <span class="nx">clamp01</span><span class="p">(</span><span class="nx">hsl</span><span class="p">.</span><span class="nx">s</span><span class="p">);</span>
|
511
|
+
<span class="k">return</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">hsl</span><span class="p">);</span>
|
512
|
+
<span class="p">}</span>
|
513
|
+
|
514
|
+
<span class="kd">function</span> <span class="nx">saturate</span><span class="p">(</span><span class="nx">color</span><span class="p">,</span> <span class="nx">amount</span><span class="p">)</span> <span class="p">{</span>
|
515
|
+
<span class="nx">amount</span> <span class="o">=</span> <span class="p">(</span><span class="nx">amount</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="p">(</span><span class="nx">amount</span> <span class="o">||</span> <span class="mi">10</span><span class="p">);</span>
|
516
|
+
<span class="kd">var</span> <span class="nx">hsl</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">).</span><span class="nx">toHsl</span><span class="p">();</span>
|
517
|
+
<span class="nx">hsl</span><span class="p">.</span><span class="nx">s</span> <span class="o">+=</span> <span class="nx">amount</span> <span class="o">/</span> <span class="mi">100</span><span class="p">;</span>
|
518
|
+
<span class="nx">hsl</span><span class="p">.</span><span class="nx">s</span> <span class="o">=</span> <span class="nx">clamp01</span><span class="p">(</span><span class="nx">hsl</span><span class="p">.</span><span class="nx">s</span><span class="p">);</span>
|
519
|
+
<span class="k">return</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">hsl</span><span class="p">);</span>
|
520
|
+
<span class="p">}</span>
|
521
|
+
|
522
|
+
<span class="kd">function</span> <span class="nx">greyscale</span><span class="p">(</span><span class="nx">color</span><span class="p">)</span> <span class="p">{</span>
|
523
|
+
<span class="k">return</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">).</span><span class="nx">desaturate</span><span class="p">(</span><span class="mi">100</span><span class="p">);</span>
|
524
|
+
<span class="p">}</span>
|
525
|
+
|
526
|
+
<span class="kd">function</span> <span class="nx">lighten</span> <span class="p">(</span><span class="nx">color</span><span class="p">,</span> <span class="nx">amount</span><span class="p">)</span> <span class="p">{</span>
|
527
|
+
<span class="nx">amount</span> <span class="o">=</span> <span class="p">(</span><span class="nx">amount</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="p">(</span><span class="nx">amount</span> <span class="o">||</span> <span class="mi">10</span><span class="p">);</span>
|
528
|
+
<span class="kd">var</span> <span class="nx">hsl</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">).</span><span class="nx">toHsl</span><span class="p">();</span>
|
529
|
+
<span class="nx">hsl</span><span class="p">.</span><span class="nx">l</span> <span class="o">+=</span> <span class="nx">amount</span> <span class="o">/</span> <span class="mi">100</span><span class="p">;</span>
|
530
|
+
<span class="nx">hsl</span><span class="p">.</span><span class="nx">l</span> <span class="o">=</span> <span class="nx">clamp01</span><span class="p">(</span><span class="nx">hsl</span><span class="p">.</span><span class="nx">l</span><span class="p">);</span>
|
531
|
+
<span class="k">return</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">hsl</span><span class="p">);</span>
|
532
|
+
<span class="p">}</span>
|
533
|
+
|
534
|
+
<span class="kd">function</span> <span class="nx">brighten</span><span class="p">(</span><span class="nx">color</span><span class="p">,</span> <span class="nx">amount</span><span class="p">)</span> <span class="p">{</span>
|
535
|
+
<span class="nx">amount</span> <span class="o">=</span> <span class="p">(</span><span class="nx">amount</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="p">(</span><span class="nx">amount</span> <span class="o">||</span> <span class="mi">10</span><span class="p">);</span>
|
536
|
+
<span class="kd">var</span> <span class="nx">rgb</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">).</span><span class="nx">toRgb</span><span class="p">();</span>
|
537
|
+
<span class="nx">rgb</span><span class="p">.</span><span class="nx">r</span> <span class="o">=</span> <span class="nx">mathMax</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nx">mathMin</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">r</span> <span class="o">-</span> <span class="nx">mathRound</span><span class="p">(</span><span class="mi">255</span> <span class="o">*</span> <span class="o">-</span> <span class="p">(</span><span class="nx">amount</span> <span class="o">/</span> <span class="mi">100</span><span class="p">))));</span>
|
538
|
+
<span class="nx">rgb</span><span class="p">.</span><span class="nx">g</span> <span class="o">=</span> <span class="nx">mathMax</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nx">mathMin</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">g</span> <span class="o">-</span> <span class="nx">mathRound</span><span class="p">(</span><span class="mi">255</span> <span class="o">*</span> <span class="o">-</span> <span class="p">(</span><span class="nx">amount</span> <span class="o">/</span> <span class="mi">100</span><span class="p">))));</span>
|
539
|
+
<span class="nx">rgb</span><span class="p">.</span><span class="nx">b</span> <span class="o">=</span> <span class="nx">mathMax</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nx">mathMin</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">b</span> <span class="o">-</span> <span class="nx">mathRound</span><span class="p">(</span><span class="mi">255</span> <span class="o">*</span> <span class="o">-</span> <span class="p">(</span><span class="nx">amount</span> <span class="o">/</span> <span class="mi">100</span><span class="p">))));</span>
|
540
|
+
<span class="k">return</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">rgb</span><span class="p">);</span>
|
541
|
+
<span class="p">}</span>
|
542
|
+
|
543
|
+
<span class="kd">function</span> <span class="nx">darken</span> <span class="p">(</span><span class="nx">color</span><span class="p">,</span> <span class="nx">amount</span><span class="p">)</span> <span class="p">{</span>
|
544
|
+
<span class="nx">amount</span> <span class="o">=</span> <span class="p">(</span><span class="nx">amount</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="p">(</span><span class="nx">amount</span> <span class="o">||</span> <span class="mi">10</span><span class="p">);</span>
|
545
|
+
<span class="kd">var</span> <span class="nx">hsl</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">).</span><span class="nx">toHsl</span><span class="p">();</span>
|
546
|
+
<span class="nx">hsl</span><span class="p">.</span><span class="nx">l</span> <span class="o">-=</span> <span class="nx">amount</span> <span class="o">/</span> <span class="mi">100</span><span class="p">;</span>
|
547
|
+
<span class="nx">hsl</span><span class="p">.</span><span class="nx">l</span> <span class="o">=</span> <span class="nx">clamp01</span><span class="p">(</span><span class="nx">hsl</span><span class="p">.</span><span class="nx">l</span><span class="p">);</span>
|
548
|
+
<span class="k">return</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">hsl</span><span class="p">);</span>
|
549
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-24"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-24">¶</a> </div> <p>Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
|
550
|
+
Values outside of this range will be wrapped into this range.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">spin</span><span class="p">(</span><span class="nx">color</span><span class="p">,</span> <span class="nx">amount</span><span class="p">)</span> <span class="p">{</span>
|
551
|
+
<span class="kd">var</span> <span class="nx">hsl</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">).</span><span class="nx">toHsl</span><span class="p">();</span>
|
552
|
+
<span class="kd">var</span> <span class="nx">hue</span> <span class="o">=</span> <span class="p">(</span><span class="nx">hsl</span><span class="p">.</span><span class="nx">h</span> <span class="o">+</span> <span class="nx">amount</span><span class="p">)</span> <span class="o">%</span> <span class="mi">360</span><span class="p">;</span>
|
553
|
+
<span class="nx">hsl</span><span class="p">.</span><span class="nx">h</span> <span class="o">=</span> <span class="nx">hue</span> <span class="o"><</span> <span class="mi">0</span> <span class="o">?</span> <span class="mi">360</span> <span class="o">+</span> <span class="nx">hue</span> <span class="o">:</span> <span class="nx">hue</span><span class="p">;</span>
|
554
|
+
<span class="k">return</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">hsl</span><span class="p">);</span>
|
555
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-25"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-25">¶</a> </div> <h2>Combination Functions</h2>
|
556
|
+
|
557
|
+
<p>Thanks to jQuery xColor for some of the ideas behind these
|
558
|
+
<a href="https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js">https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js</a></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">complement</span><span class="p">(</span><span class="nx">color</span><span class="p">)</span> <span class="p">{</span>
|
559
|
+
<span class="kd">var</span> <span class="nx">hsl</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">).</span><span class="nx">toHsl</span><span class="p">();</span>
|
560
|
+
<span class="nx">hsl</span><span class="p">.</span><span class="nx">h</span> <span class="o">=</span> <span class="p">(</span><span class="nx">hsl</span><span class="p">.</span><span class="nx">h</span> <span class="o">+</span> <span class="mi">180</span><span class="p">)</span> <span class="o">%</span> <span class="mi">360</span><span class="p">;</span>
|
561
|
+
<span class="k">return</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">hsl</span><span class="p">);</span>
|
562
|
+
<span class="p">}</span>
|
563
|
+
|
564
|
+
<span class="kd">function</span> <span class="nx">triad</span><span class="p">(</span><span class="nx">color</span><span class="p">)</span> <span class="p">{</span>
|
565
|
+
<span class="kd">var</span> <span class="nx">hsl</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">).</span><span class="nx">toHsl</span><span class="p">();</span>
|
566
|
+
<span class="kd">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">h</span><span class="p">;</span>
|
567
|
+
<span class="k">return</span> <span class="p">[</span>
|
568
|
+
<span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">),</span>
|
569
|
+
<span class="nx">tinycolor</span><span class="p">({</span> <span class="nx">h</span><span class="o">:</span> <span class="p">(</span><span class="nx">h</span> <span class="o">+</span> <span class="mi">120</span><span class="p">)</span> <span class="o">%</span> <span class="mi">360</span><span class="p">,</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">s</span><span class="p">,</span> <span class="nx">l</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">l</span> <span class="p">}),</span>
|
570
|
+
<span class="nx">tinycolor</span><span class="p">({</span> <span class="nx">h</span><span class="o">:</span> <span class="p">(</span><span class="nx">h</span> <span class="o">+</span> <span class="mi">240</span><span class="p">)</span> <span class="o">%</span> <span class="mi">360</span><span class="p">,</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">s</span><span class="p">,</span> <span class="nx">l</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">l</span> <span class="p">})</span>
|
571
|
+
<span class="p">];</span>
|
572
|
+
<span class="p">}</span>
|
573
|
+
|
574
|
+
<span class="kd">function</span> <span class="nx">tetrad</span><span class="p">(</span><span class="nx">color</span><span class="p">)</span> <span class="p">{</span>
|
575
|
+
<span class="kd">var</span> <span class="nx">hsl</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">).</span><span class="nx">toHsl</span><span class="p">();</span>
|
576
|
+
<span class="kd">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">h</span><span class="p">;</span>
|
577
|
+
<span class="k">return</span> <span class="p">[</span>
|
578
|
+
<span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">),</span>
|
579
|
+
<span class="nx">tinycolor</span><span class="p">({</span> <span class="nx">h</span><span class="o">:</span> <span class="p">(</span><span class="nx">h</span> <span class="o">+</span> <span class="mi">90</span><span class="p">)</span> <span class="o">%</span> <span class="mi">360</span><span class="p">,</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">s</span><span class="p">,</span> <span class="nx">l</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">l</span> <span class="p">}),</span>
|
580
|
+
<span class="nx">tinycolor</span><span class="p">({</span> <span class="nx">h</span><span class="o">:</span> <span class="p">(</span><span class="nx">h</span> <span class="o">+</span> <span class="mi">180</span><span class="p">)</span> <span class="o">%</span> <span class="mi">360</span><span class="p">,</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">s</span><span class="p">,</span> <span class="nx">l</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">l</span> <span class="p">}),</span>
|
581
|
+
<span class="nx">tinycolor</span><span class="p">({</span> <span class="nx">h</span><span class="o">:</span> <span class="p">(</span><span class="nx">h</span> <span class="o">+</span> <span class="mi">270</span><span class="p">)</span> <span class="o">%</span> <span class="mi">360</span><span class="p">,</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">s</span><span class="p">,</span> <span class="nx">l</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">l</span> <span class="p">})</span>
|
582
|
+
<span class="p">];</span>
|
583
|
+
<span class="p">}</span>
|
584
|
+
|
585
|
+
<span class="kd">function</span> <span class="nx">splitcomplement</span><span class="p">(</span><span class="nx">color</span><span class="p">)</span> <span class="p">{</span>
|
586
|
+
<span class="kd">var</span> <span class="nx">hsl</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">).</span><span class="nx">toHsl</span><span class="p">();</span>
|
587
|
+
<span class="kd">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">h</span><span class="p">;</span>
|
588
|
+
<span class="k">return</span> <span class="p">[</span>
|
589
|
+
<span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">),</span>
|
590
|
+
<span class="nx">tinycolor</span><span class="p">({</span> <span class="nx">h</span><span class="o">:</span> <span class="p">(</span><span class="nx">h</span> <span class="o">+</span> <span class="mi">72</span><span class="p">)</span> <span class="o">%</span> <span class="mi">360</span><span class="p">,</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">s</span><span class="p">,</span> <span class="nx">l</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">l</span><span class="p">}),</span>
|
591
|
+
<span class="nx">tinycolor</span><span class="p">({</span> <span class="nx">h</span><span class="o">:</span> <span class="p">(</span><span class="nx">h</span> <span class="o">+</span> <span class="mi">216</span><span class="p">)</span> <span class="o">%</span> <span class="mi">360</span><span class="p">,</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">s</span><span class="p">,</span> <span class="nx">l</span><span class="o">:</span> <span class="nx">hsl</span><span class="p">.</span><span class="nx">l</span><span class="p">})</span>
|
592
|
+
<span class="p">];</span>
|
593
|
+
<span class="p">}</span>
|
594
|
+
|
595
|
+
<span class="kd">function</span> <span class="nx">analogous</span><span class="p">(</span><span class="nx">color</span><span class="p">,</span> <span class="nx">results</span><span class="p">,</span> <span class="nx">slices</span><span class="p">)</span> <span class="p">{</span>
|
596
|
+
<span class="nx">results</span> <span class="o">=</span> <span class="nx">results</span> <span class="o">||</span> <span class="mi">6</span><span class="p">;</span>
|
597
|
+
<span class="nx">slices</span> <span class="o">=</span> <span class="nx">slices</span> <span class="o">||</span> <span class="mi">30</span><span class="p">;</span>
|
598
|
+
|
599
|
+
<span class="kd">var</span> <span class="nx">hsl</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">).</span><span class="nx">toHsl</span><span class="p">();</span>
|
600
|
+
<span class="kd">var</span> <span class="nx">part</span> <span class="o">=</span> <span class="mi">360</span> <span class="o">/</span> <span class="nx">slices</span><span class="p">;</span>
|
601
|
+
<span class="kd">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="p">[</span><span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">)];</span>
|
602
|
+
|
603
|
+
<span class="k">for</span> <span class="p">(</span><span class="nx">hsl</span><span class="p">.</span><span class="nx">h</span> <span class="o">=</span> <span class="p">((</span><span class="nx">hsl</span><span class="p">.</span><span class="nx">h</span> <span class="o">-</span> <span class="p">(</span><span class="nx">part</span> <span class="o">*</span> <span class="nx">results</span> <span class="o">>></span> <span class="mi">1</span><span class="p">))</span> <span class="o">+</span> <span class="mi">720</span><span class="p">)</span> <span class="o">%</span> <span class="mi">360</span><span class="p">;</span> <span class="o">--</span><span class="nx">results</span><span class="p">;</span> <span class="p">)</span> <span class="p">{</span>
|
604
|
+
<span class="nx">hsl</span><span class="p">.</span><span class="nx">h</span> <span class="o">=</span> <span class="p">(</span><span class="nx">hsl</span><span class="p">.</span><span class="nx">h</span> <span class="o">+</span> <span class="nx">part</span><span class="p">)</span> <span class="o">%</span> <span class="mi">360</span><span class="p">;</span>
|
605
|
+
<span class="nx">ret</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">tinycolor</span><span class="p">(</span><span class="nx">hsl</span><span class="p">));</span>
|
606
|
+
<span class="p">}</span>
|
607
|
+
<span class="k">return</span> <span class="nx">ret</span><span class="p">;</span>
|
608
|
+
<span class="p">}</span>
|
609
|
+
|
610
|
+
<span class="kd">function</span> <span class="nx">monochromatic</span><span class="p">(</span><span class="nx">color</span><span class="p">,</span> <span class="nx">results</span><span class="p">)</span> <span class="p">{</span>
|
611
|
+
<span class="nx">results</span> <span class="o">=</span> <span class="nx">results</span> <span class="o">||</span> <span class="mi">6</span><span class="p">;</span>
|
612
|
+
<span class="kd">var</span> <span class="nx">hsv</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">).</span><span class="nx">toHsv</span><span class="p">();</span>
|
613
|
+
<span class="kd">var</span> <span class="nx">h</span> <span class="o">=</span> <span class="nx">hsv</span><span class="p">.</span><span class="nx">h</span><span class="p">,</span> <span class="nx">s</span> <span class="o">=</span> <span class="nx">hsv</span><span class="p">.</span><span class="nx">s</span><span class="p">,</span> <span class="nx">v</span> <span class="o">=</span> <span class="nx">hsv</span><span class="p">.</span><span class="nx">v</span><span class="p">;</span>
|
614
|
+
<span class="kd">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="p">[];</span>
|
615
|
+
<span class="kd">var</span> <span class="nx">modification</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">/</span> <span class="nx">results</span><span class="p">;</span>
|
616
|
+
|
617
|
+
<span class="k">while</span> <span class="p">(</span><span class="nx">results</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
|
618
|
+
<span class="nx">ret</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">tinycolor</span><span class="p">({</span> <span class="nx">h</span><span class="o">:</span> <span class="nx">h</span><span class="p">,</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">s</span><span class="p">,</span> <span class="nx">v</span><span class="o">:</span> <span class="nx">v</span><span class="p">}));</span>
|
619
|
+
<span class="nx">v</span> <span class="o">=</span> <span class="p">(</span><span class="nx">v</span> <span class="o">+</span> <span class="nx">modification</span><span class="p">)</span> <span class="o">%</span> <span class="mi">1</span><span class="p">;</span>
|
620
|
+
<span class="p">}</span>
|
621
|
+
|
622
|
+
<span class="k">return</span> <span class="nx">ret</span><span class="p">;</span>
|
623
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-26"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-26">¶</a> </div> <h2>Utility Functions</h2> </td> <td class="code"> <div class="highlight"><pre><span class="nx">tinycolor</span><span class="p">.</span><span class="nx">mix</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">color1</span><span class="p">,</span> <span class="nx">color2</span><span class="p">,</span> <span class="nx">amount</span><span class="p">)</span> <span class="p">{</span>
|
624
|
+
<span class="nx">amount</span> <span class="o">=</span> <span class="p">(</span><span class="nx">amount</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="p">(</span><span class="nx">amount</span> <span class="o">||</span> <span class="mi">50</span><span class="p">);</span>
|
625
|
+
|
626
|
+
<span class="kd">var</span> <span class="nx">rgb1</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color1</span><span class="p">).</span><span class="nx">toRgb</span><span class="p">();</span>
|
627
|
+
<span class="kd">var</span> <span class="nx">rgb2</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color2</span><span class="p">).</span><span class="nx">toRgb</span><span class="p">();</span>
|
628
|
+
|
629
|
+
<span class="kd">var</span> <span class="nx">p</span> <span class="o">=</span> <span class="nx">amount</span> <span class="o">/</span> <span class="mi">100</span><span class="p">;</span>
|
630
|
+
|
631
|
+
<span class="kd">var</span> <span class="nx">rgba</span> <span class="o">=</span> <span class="p">{</span>
|
632
|
+
<span class="nx">r</span><span class="o">:</span> <span class="p">((</span><span class="nx">rgb2</span><span class="p">.</span><span class="nx">r</span> <span class="o">-</span> <span class="nx">rgb1</span><span class="p">.</span><span class="nx">r</span><span class="p">)</span> <span class="o">*</span> <span class="nx">p</span><span class="p">)</span> <span class="o">+</span> <span class="nx">rgb1</span><span class="p">.</span><span class="nx">r</span><span class="p">,</span>
|
633
|
+
<span class="nx">g</span><span class="o">:</span> <span class="p">((</span><span class="nx">rgb2</span><span class="p">.</span><span class="nx">g</span> <span class="o">-</span> <span class="nx">rgb1</span><span class="p">.</span><span class="nx">g</span><span class="p">)</span> <span class="o">*</span> <span class="nx">p</span><span class="p">)</span> <span class="o">+</span> <span class="nx">rgb1</span><span class="p">.</span><span class="nx">g</span><span class="p">,</span>
|
634
|
+
<span class="nx">b</span><span class="o">:</span> <span class="p">((</span><span class="nx">rgb2</span><span class="p">.</span><span class="nx">b</span> <span class="o">-</span> <span class="nx">rgb1</span><span class="p">.</span><span class="nx">b</span><span class="p">)</span> <span class="o">*</span> <span class="nx">p</span><span class="p">)</span> <span class="o">+</span> <span class="nx">rgb1</span><span class="p">.</span><span class="nx">b</span><span class="p">,</span>
|
635
|
+
<span class="nx">a</span><span class="o">:</span> <span class="p">((</span><span class="nx">rgb2</span><span class="p">.</span><span class="nx">a</span> <span class="o">-</span> <span class="nx">rgb1</span><span class="p">.</span><span class="nx">a</span><span class="p">)</span> <span class="o">*</span> <span class="nx">p</span><span class="p">)</span> <span class="o">+</span> <span class="nx">rgb1</span><span class="p">.</span><span class="nx">a</span>
|
636
|
+
<span class="p">};</span>
|
637
|
+
|
638
|
+
<span class="k">return</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">rgba</span><span class="p">);</span>
|
639
|
+
<span class="p">};</span></pre></div> </td> </tr> <tr id="section-27"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-27">¶</a> </div> <h2>Readability Functions</h2>
|
640
|
+
|
641
|
+
<p><http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-28"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-28">¶</a> </div> <p><code>contrast</code>
|
642
|
+
Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">tinycolor</span><span class="p">.</span><span class="nx">readability</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">color1</span><span class="p">,</span> <span class="nx">color2</span><span class="p">)</span> <span class="p">{</span>
|
643
|
+
<span class="kd">var</span> <span class="nx">c1</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color1</span><span class="p">);</span>
|
644
|
+
<span class="kd">var</span> <span class="nx">c2</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color2</span><span class="p">);</span>
|
645
|
+
<span class="k">return</span> <span class="p">(</span><span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">(</span><span class="nx">c1</span><span class="p">.</span><span class="nx">getLuminance</span><span class="p">(),</span><span class="nx">c2</span><span class="p">.</span><span class="nx">getLuminance</span><span class="p">())</span><span class="o">+</span><span class="mf">0.05</span><span class="p">)</span> <span class="o">/</span> <span class="p">(</span><span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">(</span><span class="nx">c1</span><span class="p">.</span><span class="nx">getLuminance</span><span class="p">(),</span><span class="nx">c2</span><span class="p">.</span><span class="nx">getLuminance</span><span class="p">())</span><span class="o">+</span><span class="mf">0.05</span><span class="p">);</span>
|
646
|
+
<span class="p">};</span></pre></div> </td> </tr> <tr id="section-29"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-29">¶</a> </div> <p><code>isReadable</code>
|
647
|
+
Ensure that foreground and background color combinations meet WCAG2 guidelines.
|
648
|
+
The third argument is an optional Object.
|
649
|
+
the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
|
650
|
+
the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
|
651
|
+
If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-30"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-30">¶</a> </div> <p><em>Example</em>
|
652
|
+
tinycolor.isReadable("#000", "#111") => false
|
653
|
+
tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">tinycolor</span><span class="p">.</span><span class="nx">isReadable</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">color1</span><span class="p">,</span> <span class="nx">color2</span><span class="p">,</span> <span class="nx">wcag2</span><span class="p">)</span> <span class="p">{</span>
|
654
|
+
<span class="kd">var</span> <span class="nx">readability</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">.</span><span class="nx">readability</span><span class="p">(</span><span class="nx">color1</span><span class="p">,</span> <span class="nx">color2</span><span class="p">);</span>
|
655
|
+
<span class="kd">var</span> <span class="nx">wcag2Parms</span><span class="p">,</span> <span class="nx">out</span><span class="p">;</span>
|
656
|
+
|
657
|
+
<span class="nx">out</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
|
658
|
+
|
659
|
+
<span class="nx">wcag2Parms</span> <span class="o">=</span> <span class="nx">validateWCAG2Parms</span><span class="p">(</span><span class="nx">wcag2</span><span class="p">);</span>
|
660
|
+
<span class="k">switch</span> <span class="p">(</span><span class="nx">wcag2Parms</span><span class="p">.</span><span class="nx">level</span> <span class="o">+</span> <span class="nx">wcag2Parms</span><span class="p">.</span><span class="nx">size</span><span class="p">)</span> <span class="p">{</span>
|
661
|
+
<span class="k">case</span> <span class="s2">"AAsmall"</span><span class="o">:</span>
|
662
|
+
<span class="k">case</span> <span class="s2">"AAAlarge"</span><span class="o">:</span>
|
663
|
+
<span class="nx">out</span> <span class="o">=</span> <span class="nx">readability</span> <span class="o">>=</span> <span class="mf">4.5</span><span class="p">;</span>
|
664
|
+
<span class="k">break</span><span class="p">;</span>
|
665
|
+
<span class="k">case</span> <span class="s2">"AAlarge"</span><span class="o">:</span>
|
666
|
+
<span class="nx">out</span> <span class="o">=</span> <span class="nx">readability</span> <span class="o">>=</span> <span class="mi">3</span><span class="p">;</span>
|
667
|
+
<span class="k">break</span><span class="p">;</span>
|
668
|
+
<span class="k">case</span> <span class="s2">"AAAsmall"</span><span class="o">:</span>
|
669
|
+
<span class="nx">out</span> <span class="o">=</span> <span class="nx">readability</span> <span class="o">>=</span> <span class="mi">7</span><span class="p">;</span>
|
670
|
+
<span class="k">break</span><span class="p">;</span>
|
671
|
+
<span class="p">}</span>
|
672
|
+
<span class="k">return</span> <span class="nx">out</span><span class="p">;</span>
|
673
|
+
|
674
|
+
<span class="p">};</span></pre></div> </td> </tr> <tr id="section-31"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-31">¶</a> </div> <p><code>mostReadable</code>
|
675
|
+
Given a base color and a list of possible foreground or background
|
676
|
+
colors for that base, returns the most readable color.
|
677
|
+
Optionally returns Black or White if the most readable color is unreadable.
|
678
|
+
<em>Example</em>
|
679
|
+
tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
|
680
|
+
tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
|
681
|
+
tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
|
682
|
+
tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">tinycolor</span><span class="p">.</span><span class="nx">mostReadable</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">baseColor</span><span class="p">,</span> <span class="nx">colorList</span><span class="p">,</span> <span class="nx">args</span><span class="p">)</span> <span class="p">{</span>
|
683
|
+
<span class="kd">var</span> <span class="nx">bestColor</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
|
684
|
+
<span class="kd">var</span> <span class="nx">bestScore</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
|
685
|
+
<span class="kd">var</span> <span class="nx">readability</span><span class="p">;</span>
|
686
|
+
<span class="kd">var</span> <span class="nx">includeFallbackColors</span><span class="p">,</span> <span class="nx">level</span><span class="p">,</span> <span class="nx">size</span> <span class="p">;</span>
|
687
|
+
<span class="nx">args</span> <span class="o">=</span> <span class="nx">args</span> <span class="o">||</span> <span class="p">{};</span>
|
688
|
+
<span class="nx">includeFallbackColors</span> <span class="o">=</span> <span class="nx">args</span><span class="p">.</span><span class="nx">includeFallbackColors</span> <span class="p">;</span>
|
689
|
+
<span class="nx">level</span> <span class="o">=</span> <span class="nx">args</span><span class="p">.</span><span class="nx">level</span><span class="p">;</span>
|
690
|
+
<span class="nx">size</span> <span class="o">=</span> <span class="nx">args</span><span class="p">.</span><span class="nx">size</span><span class="p">;</span>
|
691
|
+
|
692
|
+
<span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o"><</span> <span class="nx">colorList</span><span class="p">.</span><span class="nx">length</span> <span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
|
693
|
+
<span class="nx">readability</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">.</span><span class="nx">readability</span><span class="p">(</span><span class="nx">baseColor</span><span class="p">,</span> <span class="nx">colorList</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
|
694
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">readability</span> <span class="o">></span> <span class="nx">bestScore</span><span class="p">)</span> <span class="p">{</span>
|
695
|
+
<span class="nx">bestScore</span> <span class="o">=</span> <span class="nx">readability</span><span class="p">;</span>
|
696
|
+
<span class="nx">bestColor</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">colorList</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
|
697
|
+
<span class="p">}</span>
|
698
|
+
<span class="p">}</span>
|
699
|
+
|
700
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">tinycolor</span><span class="p">.</span><span class="nx">isReadable</span><span class="p">(</span><span class="nx">baseColor</span><span class="p">,</span> <span class="nx">bestColor</span><span class="p">,</span> <span class="p">{</span><span class="s2">"level"</span><span class="o">:</span><span class="nx">level</span><span class="p">,</span><span class="s2">"size"</span><span class="o">:</span><span class="nx">size</span><span class="p">})</span> <span class="o">||</span> <span class="o">!</span><span class="nx">includeFallbackColors</span><span class="p">)</span> <span class="p">{</span>
|
701
|
+
<span class="k">return</span> <span class="nx">bestColor</span><span class="p">;</span>
|
702
|
+
<span class="p">}</span>
|
703
|
+
<span class="k">else</span> <span class="p">{</span>
|
704
|
+
<span class="nx">args</span><span class="p">.</span><span class="nx">includeFallbackColors</span><span class="o">=</span><span class="kc">false</span><span class="p">;</span>
|
705
|
+
<span class="k">return</span> <span class="nx">tinycolor</span><span class="p">.</span><span class="nx">mostReadable</span><span class="p">(</span><span class="nx">baseColor</span><span class="p">,[</span><span class="s2">"#fff"</span><span class="p">,</span> <span class="s2">"#000"</span><span class="p">],</span><span class="nx">args</span><span class="p">);</span>
|
706
|
+
<span class="p">}</span>
|
707
|
+
<span class="p">};</span></pre></div> </td> </tr> <tr id="section-32"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-32">¶</a> </div> <h2>Big List of Colors</h2>
|
708
|
+
|
709
|
+
<p><a href="http://www.w3.org/TR/css3-color/#svg-color">http://www.w3.org/TR/css3-color/#svg-color</a></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">names</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">.</span><span class="nx">names</span> <span class="o">=</span> <span class="p">{</span>
|
710
|
+
<span class="nx">aliceblue</span><span class="o">:</span> <span class="s2">"f0f8ff"</span><span class="p">,</span>
|
711
|
+
<span class="nx">antiquewhite</span><span class="o">:</span> <span class="s2">"faebd7"</span><span class="p">,</span>
|
712
|
+
<span class="nx">aqua</span><span class="o">:</span> <span class="s2">"0ff"</span><span class="p">,</span>
|
713
|
+
<span class="nx">aquamarine</span><span class="o">:</span> <span class="s2">"7fffd4"</span><span class="p">,</span>
|
714
|
+
<span class="nx">azure</span><span class="o">:</span> <span class="s2">"f0ffff"</span><span class="p">,</span>
|
715
|
+
<span class="nx">beige</span><span class="o">:</span> <span class="s2">"f5f5dc"</span><span class="p">,</span>
|
716
|
+
<span class="nx">bisque</span><span class="o">:</span> <span class="s2">"ffe4c4"</span><span class="p">,</span>
|
717
|
+
<span class="nx">black</span><span class="o">:</span> <span class="s2">"000"</span><span class="p">,</span>
|
718
|
+
<span class="nx">blanchedalmond</span><span class="o">:</span> <span class="s2">"ffebcd"</span><span class="p">,</span>
|
719
|
+
<span class="nx">blue</span><span class="o">:</span> <span class="s2">"00f"</span><span class="p">,</span>
|
720
|
+
<span class="nx">blueviolet</span><span class="o">:</span> <span class="s2">"8a2be2"</span><span class="p">,</span>
|
721
|
+
<span class="nx">brown</span><span class="o">:</span> <span class="s2">"a52a2a"</span><span class="p">,</span>
|
722
|
+
<span class="nx">burlywood</span><span class="o">:</span> <span class="s2">"deb887"</span><span class="p">,</span>
|
723
|
+
<span class="nx">burntsienna</span><span class="o">:</span> <span class="s2">"ea7e5d"</span><span class="p">,</span>
|
724
|
+
<span class="nx">cadetblue</span><span class="o">:</span> <span class="s2">"5f9ea0"</span><span class="p">,</span>
|
725
|
+
<span class="nx">chartreuse</span><span class="o">:</span> <span class="s2">"7fff00"</span><span class="p">,</span>
|
726
|
+
<span class="nx">chocolate</span><span class="o">:</span> <span class="s2">"d2691e"</span><span class="p">,</span>
|
727
|
+
<span class="nx">coral</span><span class="o">:</span> <span class="s2">"ff7f50"</span><span class="p">,</span>
|
728
|
+
<span class="nx">cornflowerblue</span><span class="o">:</span> <span class="s2">"6495ed"</span><span class="p">,</span>
|
729
|
+
<span class="nx">cornsilk</span><span class="o">:</span> <span class="s2">"fff8dc"</span><span class="p">,</span>
|
730
|
+
<span class="nx">crimson</span><span class="o">:</span> <span class="s2">"dc143c"</span><span class="p">,</span>
|
731
|
+
<span class="nx">cyan</span><span class="o">:</span> <span class="s2">"0ff"</span><span class="p">,</span>
|
732
|
+
<span class="nx">darkblue</span><span class="o">:</span> <span class="s2">"00008b"</span><span class="p">,</span>
|
733
|
+
<span class="nx">darkcyan</span><span class="o">:</span> <span class="s2">"008b8b"</span><span class="p">,</span>
|
734
|
+
<span class="nx">darkgoldenrod</span><span class="o">:</span> <span class="s2">"b8860b"</span><span class="p">,</span>
|
735
|
+
<span class="nx">darkgray</span><span class="o">:</span> <span class="s2">"a9a9a9"</span><span class="p">,</span>
|
736
|
+
<span class="nx">darkgreen</span><span class="o">:</span> <span class="s2">"006400"</span><span class="p">,</span>
|
737
|
+
<span class="nx">darkgrey</span><span class="o">:</span> <span class="s2">"a9a9a9"</span><span class="p">,</span>
|
738
|
+
<span class="nx">darkkhaki</span><span class="o">:</span> <span class="s2">"bdb76b"</span><span class="p">,</span>
|
739
|
+
<span class="nx">darkmagenta</span><span class="o">:</span> <span class="s2">"8b008b"</span><span class="p">,</span>
|
740
|
+
<span class="nx">darkolivegreen</span><span class="o">:</span> <span class="s2">"556b2f"</span><span class="p">,</span>
|
741
|
+
<span class="nx">darkorange</span><span class="o">:</span> <span class="s2">"ff8c00"</span><span class="p">,</span>
|
742
|
+
<span class="nx">darkorchid</span><span class="o">:</span> <span class="s2">"9932cc"</span><span class="p">,</span>
|
743
|
+
<span class="nx">darkred</span><span class="o">:</span> <span class="s2">"8b0000"</span><span class="p">,</span>
|
744
|
+
<span class="nx">darksalmon</span><span class="o">:</span> <span class="s2">"e9967a"</span><span class="p">,</span>
|
745
|
+
<span class="nx">darkseagreen</span><span class="o">:</span> <span class="s2">"8fbc8f"</span><span class="p">,</span>
|
746
|
+
<span class="nx">darkslateblue</span><span class="o">:</span> <span class="s2">"483d8b"</span><span class="p">,</span>
|
747
|
+
<span class="nx">darkslategray</span><span class="o">:</span> <span class="s2">"2f4f4f"</span><span class="p">,</span>
|
748
|
+
<span class="nx">darkslategrey</span><span class="o">:</span> <span class="s2">"2f4f4f"</span><span class="p">,</span>
|
749
|
+
<span class="nx">darkturquoise</span><span class="o">:</span> <span class="s2">"00ced1"</span><span class="p">,</span>
|
750
|
+
<span class="nx">darkviolet</span><span class="o">:</span> <span class="s2">"9400d3"</span><span class="p">,</span>
|
751
|
+
<span class="nx">deeppink</span><span class="o">:</span> <span class="s2">"ff1493"</span><span class="p">,</span>
|
752
|
+
<span class="nx">deepskyblue</span><span class="o">:</span> <span class="s2">"00bfff"</span><span class="p">,</span>
|
753
|
+
<span class="nx">dimgray</span><span class="o">:</span> <span class="s2">"696969"</span><span class="p">,</span>
|
754
|
+
<span class="nx">dimgrey</span><span class="o">:</span> <span class="s2">"696969"</span><span class="p">,</span>
|
755
|
+
<span class="nx">dodgerblue</span><span class="o">:</span> <span class="s2">"1e90ff"</span><span class="p">,</span>
|
756
|
+
<span class="nx">firebrick</span><span class="o">:</span> <span class="s2">"b22222"</span><span class="p">,</span>
|
757
|
+
<span class="nx">floralwhite</span><span class="o">:</span> <span class="s2">"fffaf0"</span><span class="p">,</span>
|
758
|
+
<span class="nx">forestgreen</span><span class="o">:</span> <span class="s2">"228b22"</span><span class="p">,</span>
|
759
|
+
<span class="nx">fuchsia</span><span class="o">:</span> <span class="s2">"f0f"</span><span class="p">,</span>
|
760
|
+
<span class="nx">gainsboro</span><span class="o">:</span> <span class="s2">"dcdcdc"</span><span class="p">,</span>
|
761
|
+
<span class="nx">ghostwhite</span><span class="o">:</span> <span class="s2">"f8f8ff"</span><span class="p">,</span>
|
762
|
+
<span class="nx">gold</span><span class="o">:</span> <span class="s2">"ffd700"</span><span class="p">,</span>
|
763
|
+
<span class="nx">goldenrod</span><span class="o">:</span> <span class="s2">"daa520"</span><span class="p">,</span>
|
764
|
+
<span class="nx">gray</span><span class="o">:</span> <span class="s2">"808080"</span><span class="p">,</span>
|
765
|
+
<span class="nx">green</span><span class="o">:</span> <span class="s2">"008000"</span><span class="p">,</span>
|
766
|
+
<span class="nx">greenyellow</span><span class="o">:</span> <span class="s2">"adff2f"</span><span class="p">,</span>
|
767
|
+
<span class="nx">grey</span><span class="o">:</span> <span class="s2">"808080"</span><span class="p">,</span>
|
768
|
+
<span class="nx">honeydew</span><span class="o">:</span> <span class="s2">"f0fff0"</span><span class="p">,</span>
|
769
|
+
<span class="nx">hotpink</span><span class="o">:</span> <span class="s2">"ff69b4"</span><span class="p">,</span>
|
770
|
+
<span class="nx">indianred</span><span class="o">:</span> <span class="s2">"cd5c5c"</span><span class="p">,</span>
|
771
|
+
<span class="nx">indigo</span><span class="o">:</span> <span class="s2">"4b0082"</span><span class="p">,</span>
|
772
|
+
<span class="nx">ivory</span><span class="o">:</span> <span class="s2">"fffff0"</span><span class="p">,</span>
|
773
|
+
<span class="nx">khaki</span><span class="o">:</span> <span class="s2">"f0e68c"</span><span class="p">,</span>
|
774
|
+
<span class="nx">lavender</span><span class="o">:</span> <span class="s2">"e6e6fa"</span><span class="p">,</span>
|
775
|
+
<span class="nx">lavenderblush</span><span class="o">:</span> <span class="s2">"fff0f5"</span><span class="p">,</span>
|
776
|
+
<span class="nx">lawngreen</span><span class="o">:</span> <span class="s2">"7cfc00"</span><span class="p">,</span>
|
777
|
+
<span class="nx">lemonchiffon</span><span class="o">:</span> <span class="s2">"fffacd"</span><span class="p">,</span>
|
778
|
+
<span class="nx">lightblue</span><span class="o">:</span> <span class="s2">"add8e6"</span><span class="p">,</span>
|
779
|
+
<span class="nx">lightcoral</span><span class="o">:</span> <span class="s2">"f08080"</span><span class="p">,</span>
|
780
|
+
<span class="nx">lightcyan</span><span class="o">:</span> <span class="s2">"e0ffff"</span><span class="p">,</span>
|
781
|
+
<span class="nx">lightgoldenrodyellow</span><span class="o">:</span> <span class="s2">"fafad2"</span><span class="p">,</span>
|
782
|
+
<span class="nx">lightgray</span><span class="o">:</span> <span class="s2">"d3d3d3"</span><span class="p">,</span>
|
783
|
+
<span class="nx">lightgreen</span><span class="o">:</span> <span class="s2">"90ee90"</span><span class="p">,</span>
|
784
|
+
<span class="nx">lightgrey</span><span class="o">:</span> <span class="s2">"d3d3d3"</span><span class="p">,</span>
|
785
|
+
<span class="nx">lightpink</span><span class="o">:</span> <span class="s2">"ffb6c1"</span><span class="p">,</span>
|
786
|
+
<span class="nx">lightsalmon</span><span class="o">:</span> <span class="s2">"ffa07a"</span><span class="p">,</span>
|
787
|
+
<span class="nx">lightseagreen</span><span class="o">:</span> <span class="s2">"20b2aa"</span><span class="p">,</span>
|
788
|
+
<span class="nx">lightskyblue</span><span class="o">:</span> <span class="s2">"87cefa"</span><span class="p">,</span>
|
789
|
+
<span class="nx">lightslategray</span><span class="o">:</span> <span class="s2">"789"</span><span class="p">,</span>
|
790
|
+
<span class="nx">lightslategrey</span><span class="o">:</span> <span class="s2">"789"</span><span class="p">,</span>
|
791
|
+
<span class="nx">lightsteelblue</span><span class="o">:</span> <span class="s2">"b0c4de"</span><span class="p">,</span>
|
792
|
+
<span class="nx">lightyellow</span><span class="o">:</span> <span class="s2">"ffffe0"</span><span class="p">,</span>
|
793
|
+
<span class="nx">lime</span><span class="o">:</span> <span class="s2">"0f0"</span><span class="p">,</span>
|
794
|
+
<span class="nx">limegreen</span><span class="o">:</span> <span class="s2">"32cd32"</span><span class="p">,</span>
|
795
|
+
<span class="nx">linen</span><span class="o">:</span> <span class="s2">"faf0e6"</span><span class="p">,</span>
|
796
|
+
<span class="nx">magenta</span><span class="o">:</span> <span class="s2">"f0f"</span><span class="p">,</span>
|
797
|
+
<span class="nx">maroon</span><span class="o">:</span> <span class="s2">"800000"</span><span class="p">,</span>
|
798
|
+
<span class="nx">mediumaquamarine</span><span class="o">:</span> <span class="s2">"66cdaa"</span><span class="p">,</span>
|
799
|
+
<span class="nx">mediumblue</span><span class="o">:</span> <span class="s2">"0000cd"</span><span class="p">,</span>
|
800
|
+
<span class="nx">mediumorchid</span><span class="o">:</span> <span class="s2">"ba55d3"</span><span class="p">,</span>
|
801
|
+
<span class="nx">mediumpurple</span><span class="o">:</span> <span class="s2">"9370db"</span><span class="p">,</span>
|
802
|
+
<span class="nx">mediumseagreen</span><span class="o">:</span> <span class="s2">"3cb371"</span><span class="p">,</span>
|
803
|
+
<span class="nx">mediumslateblue</span><span class="o">:</span> <span class="s2">"7b68ee"</span><span class="p">,</span>
|
804
|
+
<span class="nx">mediumspringgreen</span><span class="o">:</span> <span class="s2">"00fa9a"</span><span class="p">,</span>
|
805
|
+
<span class="nx">mediumturquoise</span><span class="o">:</span> <span class="s2">"48d1cc"</span><span class="p">,</span>
|
806
|
+
<span class="nx">mediumvioletred</span><span class="o">:</span> <span class="s2">"c71585"</span><span class="p">,</span>
|
807
|
+
<span class="nx">midnightblue</span><span class="o">:</span> <span class="s2">"191970"</span><span class="p">,</span>
|
808
|
+
<span class="nx">mintcream</span><span class="o">:</span> <span class="s2">"f5fffa"</span><span class="p">,</span>
|
809
|
+
<span class="nx">mistyrose</span><span class="o">:</span> <span class="s2">"ffe4e1"</span><span class="p">,</span>
|
810
|
+
<span class="nx">moccasin</span><span class="o">:</span> <span class="s2">"ffe4b5"</span><span class="p">,</span>
|
811
|
+
<span class="nx">navajowhite</span><span class="o">:</span> <span class="s2">"ffdead"</span><span class="p">,</span>
|
812
|
+
<span class="nx">navy</span><span class="o">:</span> <span class="s2">"000080"</span><span class="p">,</span>
|
813
|
+
<span class="nx">oldlace</span><span class="o">:</span> <span class="s2">"fdf5e6"</span><span class="p">,</span>
|
814
|
+
<span class="nx">olive</span><span class="o">:</span> <span class="s2">"808000"</span><span class="p">,</span>
|
815
|
+
<span class="nx">olivedrab</span><span class="o">:</span> <span class="s2">"6b8e23"</span><span class="p">,</span>
|
816
|
+
<span class="nx">orange</span><span class="o">:</span> <span class="s2">"ffa500"</span><span class="p">,</span>
|
817
|
+
<span class="nx">orangered</span><span class="o">:</span> <span class="s2">"ff4500"</span><span class="p">,</span>
|
818
|
+
<span class="nx">orchid</span><span class="o">:</span> <span class="s2">"da70d6"</span><span class="p">,</span>
|
819
|
+
<span class="nx">palegoldenrod</span><span class="o">:</span> <span class="s2">"eee8aa"</span><span class="p">,</span>
|
820
|
+
<span class="nx">palegreen</span><span class="o">:</span> <span class="s2">"98fb98"</span><span class="p">,</span>
|
821
|
+
<span class="nx">paleturquoise</span><span class="o">:</span> <span class="s2">"afeeee"</span><span class="p">,</span>
|
822
|
+
<span class="nx">palevioletred</span><span class="o">:</span> <span class="s2">"db7093"</span><span class="p">,</span>
|
823
|
+
<span class="nx">papayawhip</span><span class="o">:</span> <span class="s2">"ffefd5"</span><span class="p">,</span>
|
824
|
+
<span class="nx">peachpuff</span><span class="o">:</span> <span class="s2">"ffdab9"</span><span class="p">,</span>
|
825
|
+
<span class="nx">peru</span><span class="o">:</span> <span class="s2">"cd853f"</span><span class="p">,</span>
|
826
|
+
<span class="nx">pink</span><span class="o">:</span> <span class="s2">"ffc0cb"</span><span class="p">,</span>
|
827
|
+
<span class="nx">plum</span><span class="o">:</span> <span class="s2">"dda0dd"</span><span class="p">,</span>
|
828
|
+
<span class="nx">powderblue</span><span class="o">:</span> <span class="s2">"b0e0e6"</span><span class="p">,</span>
|
829
|
+
<span class="nx">purple</span><span class="o">:</span> <span class="s2">"800080"</span><span class="p">,</span>
|
830
|
+
<span class="nx">rebeccapurple</span><span class="o">:</span> <span class="s2">"663399"</span><span class="p">,</span>
|
831
|
+
<span class="nx">red</span><span class="o">:</span> <span class="s2">"f00"</span><span class="p">,</span>
|
832
|
+
<span class="nx">rosybrown</span><span class="o">:</span> <span class="s2">"bc8f8f"</span><span class="p">,</span>
|
833
|
+
<span class="nx">royalblue</span><span class="o">:</span> <span class="s2">"4169e1"</span><span class="p">,</span>
|
834
|
+
<span class="nx">saddlebrown</span><span class="o">:</span> <span class="s2">"8b4513"</span><span class="p">,</span>
|
835
|
+
<span class="nx">salmon</span><span class="o">:</span> <span class="s2">"fa8072"</span><span class="p">,</span>
|
836
|
+
<span class="nx">sandybrown</span><span class="o">:</span> <span class="s2">"f4a460"</span><span class="p">,</span>
|
837
|
+
<span class="nx">seagreen</span><span class="o">:</span> <span class="s2">"2e8b57"</span><span class="p">,</span>
|
838
|
+
<span class="nx">seashell</span><span class="o">:</span> <span class="s2">"fff5ee"</span><span class="p">,</span>
|
839
|
+
<span class="nx">sienna</span><span class="o">:</span> <span class="s2">"a0522d"</span><span class="p">,</span>
|
840
|
+
<span class="nx">silver</span><span class="o">:</span> <span class="s2">"c0c0c0"</span><span class="p">,</span>
|
841
|
+
<span class="nx">skyblue</span><span class="o">:</span> <span class="s2">"87ceeb"</span><span class="p">,</span>
|
842
|
+
<span class="nx">slateblue</span><span class="o">:</span> <span class="s2">"6a5acd"</span><span class="p">,</span>
|
843
|
+
<span class="nx">slategray</span><span class="o">:</span> <span class="s2">"708090"</span><span class="p">,</span>
|
844
|
+
<span class="nx">slategrey</span><span class="o">:</span> <span class="s2">"708090"</span><span class="p">,</span>
|
845
|
+
<span class="nx">snow</span><span class="o">:</span> <span class="s2">"fffafa"</span><span class="p">,</span>
|
846
|
+
<span class="nx">springgreen</span><span class="o">:</span> <span class="s2">"00ff7f"</span><span class="p">,</span>
|
847
|
+
<span class="nx">steelblue</span><span class="o">:</span> <span class="s2">"4682b4"</span><span class="p">,</span>
|
848
|
+
<span class="nx">tan</span><span class="o">:</span> <span class="s2">"d2b48c"</span><span class="p">,</span>
|
849
|
+
<span class="nx">teal</span><span class="o">:</span> <span class="s2">"008080"</span><span class="p">,</span>
|
850
|
+
<span class="nx">thistle</span><span class="o">:</span> <span class="s2">"d8bfd8"</span><span class="p">,</span>
|
851
|
+
<span class="nx">tomato</span><span class="o">:</span> <span class="s2">"ff6347"</span><span class="p">,</span>
|
852
|
+
<span class="nx">turquoise</span><span class="o">:</span> <span class="s2">"40e0d0"</span><span class="p">,</span>
|
853
|
+
<span class="nx">violet</span><span class="o">:</span> <span class="s2">"ee82ee"</span><span class="p">,</span>
|
854
|
+
<span class="nx">wheat</span><span class="o">:</span> <span class="s2">"f5deb3"</span><span class="p">,</span>
|
855
|
+
<span class="nx">white</span><span class="o">:</span> <span class="s2">"fff"</span><span class="p">,</span>
|
856
|
+
<span class="nx">whitesmoke</span><span class="o">:</span> <span class="s2">"f5f5f5"</span><span class="p">,</span>
|
857
|
+
<span class="nx">yellow</span><span class="o">:</span> <span class="s2">"ff0"</span><span class="p">,</span>
|
858
|
+
<span class="nx">yellowgreen</span><span class="o">:</span> <span class="s2">"9acd32"</span>
|
859
|
+
<span class="p">};</span></pre></div> </td> </tr> <tr id="section-33"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-33">¶</a> </div> <p>Make it easy to access colors via <code>hexNames[hex]</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">hexNames</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">.</span><span class="nx">hexNames</span> <span class="o">=</span> <span class="nx">flip</span><span class="p">(</span><span class="nx">names</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-34"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-34">¶</a> </div> <h2>Utilities</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-35"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-35">¶</a> </div> <p><code>{ 'name1': 'val1' }</code> becomes <code>{ 'val1': 'name1' }</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">flip</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
|
860
|
+
<span class="kd">var</span> <span class="nx">flipped</span> <span class="o">=</span> <span class="p">{</span> <span class="p">};</span>
|
861
|
+
<span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
|
862
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">o</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
|
863
|
+
<span class="nx">flipped</span><span class="p">[</span><span class="nx">o</span><span class="p">[</span><span class="nx">i</span><span class="p">]]</span> <span class="o">=</span> <span class="nx">i</span><span class="p">;</span>
|
864
|
+
<span class="p">}</span>
|
865
|
+
<span class="p">}</span>
|
866
|
+
<span class="k">return</span> <span class="nx">flipped</span><span class="p">;</span>
|
867
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-36"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-36">¶</a> </div> <p>Return a valid alpha value [0,1] with all invalid values being set to 1</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">boundAlpha</span><span class="p">(</span><span class="nx">a</span><span class="p">)</span> <span class="p">{</span>
|
868
|
+
<span class="nx">a</span> <span class="o">=</span> <span class="nb">parseFloat</span><span class="p">(</span><span class="nx">a</span><span class="p">);</span>
|
869
|
+
|
870
|
+
<span class="k">if</span> <span class="p">(</span><span class="nb">isNaN</span><span class="p">(</span><span class="nx">a</span><span class="p">)</span> <span class="o">||</span> <span class="nx">a</span> <span class="o"><</span> <span class="mi">0</span> <span class="o">||</span> <span class="nx">a</span> <span class="o">></span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
|
871
|
+
<span class="nx">a</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
|
872
|
+
<span class="p">}</span>
|
873
|
+
|
874
|
+
<span class="k">return</span> <span class="nx">a</span><span class="p">;</span>
|
875
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-37"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-37">¶</a> </div> <p>Take input from [0, n] and return it as [0, 1]</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">bound01</span><span class="p">(</span><span class="nx">n</span><span class="p">,</span> <span class="nx">max</span><span class="p">)</span> <span class="p">{</span>
|
876
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">isOnePointZero</span><span class="p">(</span><span class="nx">n</span><span class="p">))</span> <span class="p">{</span> <span class="nx">n</span> <span class="o">=</span> <span class="s2">"100%"</span><span class="p">;</span> <span class="p">}</span>
|
877
|
+
|
878
|
+
<span class="kd">var</span> <span class="nx">processPercent</span> <span class="o">=</span> <span class="nx">isPercentage</span><span class="p">(</span><span class="nx">n</span><span class="p">);</span>
|
879
|
+
<span class="nx">n</span> <span class="o">=</span> <span class="nx">mathMin</span><span class="p">(</span><span class="nx">max</span><span class="p">,</span> <span class="nx">mathMax</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">parseFloat</span><span class="p">(</span><span class="nx">n</span><span class="p">)));</span></pre></div> </td> </tr> <tr id="section-38"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-38">¶</a> </div> <p>Automatically convert percentage into number</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="nx">processPercent</span><span class="p">)</span> <span class="p">{</span>
|
880
|
+
<span class="nx">n</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">n</span> <span class="o">*</span> <span class="nx">max</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span> <span class="o">/</span> <span class="mi">100</span><span class="p">;</span>
|
881
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-39"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-39">¶</a> </div> <p>Handle floating point rounding errors</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">((</span><span class="nb">Math</span><span class="p">.</span><span class="nx">abs</span><span class="p">(</span><span class="nx">n</span> <span class="o">-</span> <span class="nx">max</span><span class="p">)</span> <span class="o"><</span> <span class="mf">0.000001</span><span class="p">))</span> <span class="p">{</span>
|
882
|
+
<span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
|
883
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-40"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-40">¶</a> </div> <p>Convert into [0, 1] range if it isn't already</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">return</span> <span class="p">(</span><span class="nx">n</span> <span class="o">%</span> <span class="nx">max</span><span class="p">)</span> <span class="o">/</span> <span class="nb">parseFloat</span><span class="p">(</span><span class="nx">max</span><span class="p">);</span>
|
884
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-41"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-41">¶</a> </div> <p>Force a number between 0 and 1</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">clamp01</span><span class="p">(</span><span class="nx">val</span><span class="p">)</span> <span class="p">{</span>
|
885
|
+
<span class="k">return</span> <span class="nx">mathMin</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="nx">mathMax</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nx">val</span><span class="p">));</span>
|
886
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-42"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-42">¶</a> </div> <p>Parse a base-16 hex value into a base-10 integer</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">parseIntFromHex</span><span class="p">(</span><span class="nx">val</span><span class="p">)</span> <span class="p">{</span>
|
887
|
+
<span class="k">return</span> <span class="nb">parseInt</span><span class="p">(</span><span class="nx">val</span><span class="p">,</span> <span class="mi">16</span><span class="p">);</span>
|
888
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-43"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-43">¶</a> </div> <p>Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
|
889
|
+
<a href="http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0">http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0</a></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">isOnePointZero</span><span class="p">(</span><span class="nx">n</span><span class="p">)</span> <span class="p">{</span>
|
890
|
+
<span class="k">return</span> <span class="k">typeof</span> <span class="nx">n</span> <span class="o">==</span> <span class="s2">"string"</span> <span class="o">&&</span> <span class="nx">n</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">'.'</span><span class="p">)</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span> <span class="o">&&</span> <span class="nb">parseFloat</span><span class="p">(</span><span class="nx">n</span><span class="p">)</span> <span class="o">===</span> <span class="mi">1</span><span class="p">;</span>
|
891
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-44"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-44">¶</a> </div> <p>Check to see if string passed in is a percentage</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">isPercentage</span><span class="p">(</span><span class="nx">n</span><span class="p">)</span> <span class="p">{</span>
|
892
|
+
<span class="k">return</span> <span class="k">typeof</span> <span class="nx">n</span> <span class="o">===</span> <span class="s2">"string"</span> <span class="o">&&</span> <span class="nx">n</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">'%'</span><span class="p">)</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
|
893
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-45"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-45">¶</a> </div> <p>Force a hex value to have 2 characters</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">pad2</span><span class="p">(</span><span class="nx">c</span><span class="p">)</span> <span class="p">{</span>
|
894
|
+
<span class="k">return</span> <span class="nx">c</span><span class="p">.</span><span class="nx">length</span> <span class="o">==</span> <span class="mi">1</span> <span class="o">?</span> <span class="s1">'0'</span> <span class="o">+</span> <span class="nx">c</span> <span class="o">:</span> <span class="s1">''</span> <span class="o">+</span> <span class="nx">c</span><span class="p">;</span>
|
895
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-46"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-46">¶</a> </div> <p>Replace a decimal with it's percentage value</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">convertToPercentage</span><span class="p">(</span><span class="nx">n</span><span class="p">)</span> <span class="p">{</span>
|
896
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">n</span> <span class="o"><=</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
|
897
|
+
<span class="nx">n</span> <span class="o">=</span> <span class="p">(</span><span class="nx">n</span> <span class="o">*</span> <span class="mi">100</span><span class="p">)</span> <span class="o">+</span> <span class="s2">"%"</span><span class="p">;</span>
|
898
|
+
<span class="p">}</span>
|
899
|
+
|
900
|
+
<span class="k">return</span> <span class="nx">n</span><span class="p">;</span>
|
901
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-47"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-47">¶</a> </div> <p>Converts a decimal to a hex value</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">convertDecimalToHex</span><span class="p">(</span><span class="nx">d</span><span class="p">)</span> <span class="p">{</span>
|
902
|
+
<span class="k">return</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">round</span><span class="p">(</span><span class="nb">parseFloat</span><span class="p">(</span><span class="nx">d</span><span class="p">)</span> <span class="o">*</span> <span class="mi">255</span><span class="p">).</span><span class="nx">toString</span><span class="p">(</span><span class="mi">16</span><span class="p">);</span>
|
903
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-48"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-48">¶</a> </div> <p>Converts a hex value to a decimal</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">convertHexToDecimal</span><span class="p">(</span><span class="nx">h</span><span class="p">)</span> <span class="p">{</span>
|
904
|
+
<span class="k">return</span> <span class="p">(</span><span class="nx">parseIntFromHex</span><span class="p">(</span><span class="nx">h</span><span class="p">)</span> <span class="o">/</span> <span class="mi">255</span><span class="p">);</span>
|
905
|
+
<span class="p">}</span>
|
906
|
+
|
907
|
+
<span class="kd">var</span> <span class="nx">matchers</span> <span class="o">=</span> <span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-49"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-49">¶</a> </div> <p><a href="http://www.w3.org/TR/css3-values/#integers">http://www.w3.org/TR/css3-values/#integers</a></p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">CSS_INTEGER</span> <span class="o">=</span> <span class="s2">"[-\\+]?\\d+%?"</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-50"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-50">¶</a> </div> <p><a href="http://www.w3.org/TR/css3-values/#number-value">http://www.w3.org/TR/css3-values/#number-value</a></p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">CSS_NUMBER</span> <span class="o">=</span> <span class="s2">"[-\\+]?\\d*\\.\\d+%?"</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-51"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-51">¶</a> </div> <p>Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">CSS_UNIT</span> <span class="o">=</span> <span class="s2">"(?:"</span> <span class="o">+</span> <span class="nx">CSS_NUMBER</span> <span class="o">+</span> <span class="s2">")|(?:"</span> <span class="o">+</span> <span class="nx">CSS_INTEGER</span> <span class="o">+</span> <span class="s2">")"</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-52"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-52">¶</a> </div> <p>Actual matching.
|
908
|
+
Parentheses and commas are optional, but not required.
|
909
|
+
Whitespace can take the place of commas or opening paren</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">PERMISSIVE_MATCH3</span> <span class="o">=</span> <span class="s2">"[\\s|\\(]+("</span> <span class="o">+</span> <span class="nx">CSS_UNIT</span> <span class="o">+</span> <span class="s2">")[,|\\s]+("</span> <span class="o">+</span> <span class="nx">CSS_UNIT</span> <span class="o">+</span> <span class="s2">")[,|\\s]+("</span> <span class="o">+</span> <span class="nx">CSS_UNIT</span> <span class="o">+</span> <span class="s2">")\\s*\\)?"</span><span class="p">;</span>
|
910
|
+
<span class="kd">var</span> <span class="nx">PERMISSIVE_MATCH4</span> <span class="o">=</span> <span class="s2">"[\\s|\\(]+("</span> <span class="o">+</span> <span class="nx">CSS_UNIT</span> <span class="o">+</span> <span class="s2">")[,|\\s]+("</span> <span class="o">+</span> <span class="nx">CSS_UNIT</span> <span class="o">+</span> <span class="s2">")[,|\\s]+("</span> <span class="o">+</span> <span class="nx">CSS_UNIT</span> <span class="o">+</span> <span class="s2">")[,|\\s]+("</span> <span class="o">+</span> <span class="nx">CSS_UNIT</span> <span class="o">+</span> <span class="s2">")\\s*\\)?"</span><span class="p">;</span>
|
911
|
+
|
912
|
+
<span class="k">return</span> <span class="p">{</span>
|
913
|
+
<span class="nx">CSS_UNIT</span><span class="o">:</span> <span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="nx">CSS_UNIT</span><span class="p">),</span>
|
914
|
+
<span class="nx">rgb</span><span class="o">:</span> <span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="s2">"rgb"</span> <span class="o">+</span> <span class="nx">PERMISSIVE_MATCH3</span><span class="p">),</span>
|
915
|
+
<span class="nx">rgba</span><span class="o">:</span> <span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="s2">"rgba"</span> <span class="o">+</span> <span class="nx">PERMISSIVE_MATCH4</span><span class="p">),</span>
|
916
|
+
<span class="nx">hsl</span><span class="o">:</span> <span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="s2">"hsl"</span> <span class="o">+</span> <span class="nx">PERMISSIVE_MATCH3</span><span class="p">),</span>
|
917
|
+
<span class="nx">hsla</span><span class="o">:</span> <span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="s2">"hsla"</span> <span class="o">+</span> <span class="nx">PERMISSIVE_MATCH4</span><span class="p">),</span>
|
918
|
+
<span class="nx">hsv</span><span class="o">:</span> <span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="s2">"hsv"</span> <span class="o">+</span> <span class="nx">PERMISSIVE_MATCH3</span><span class="p">),</span>
|
919
|
+
<span class="nx">hsva</span><span class="o">:</span> <span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="s2">"hsva"</span> <span class="o">+</span> <span class="nx">PERMISSIVE_MATCH4</span><span class="p">),</span>
|
920
|
+
<span class="nx">hex3</span><span class="o">:</span> <span class="sr">/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/</span><span class="p">,</span>
|
921
|
+
<span class="nx">hex6</span><span class="o">:</span> <span class="sr">/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/</span><span class="p">,</span>
|
922
|
+
<span class="nx">hex4</span><span class="o">:</span> <span class="sr">/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/</span><span class="p">,</span>
|
923
|
+
<span class="nx">hex8</span><span class="o">:</span> <span class="sr">/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/</span>
|
924
|
+
<span class="p">};</span>
|
925
|
+
<span class="p">})();</span></pre></div> </td> </tr> <tr id="section-53"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-53">¶</a> </div> <p><code>isValidCSSUnit</code>
|
926
|
+
Take in a single string / number and check to see if it looks like a CSS unit
|
927
|
+
(see <code>matchers</code> above for definition).</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">isValidCSSUnit</span><span class="p">(</span><span class="nx">color</span><span class="p">)</span> <span class="p">{</span>
|
928
|
+
<span class="k">return</span> <span class="o">!!</span><span class="nx">matchers</span><span class="p">.</span><span class="nx">CSS_UNIT</span><span class="p">.</span><span class="nx">exec</span><span class="p">(</span><span class="nx">color</span><span class="p">);</span>
|
929
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-54"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-54">¶</a> </div> <p><code>stringInputToObject</code>
|
930
|
+
Permissive string parsing. Take in a number of formats, and output an object
|
931
|
+
based on detected format. Returns <code>{ r, g, b }</code> or <code>{ h, s, l }</code> or <code>{ h, s, v}</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">stringInputToObject</span><span class="p">(</span><span class="nx">color</span><span class="p">)</span> <span class="p">{</span>
|
932
|
+
|
933
|
+
<span class="nx">color</span> <span class="o">=</span> <span class="nx">color</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="nx">trimLeft</span><span class="p">,</span><span class="s1">''</span><span class="p">).</span><span class="nx">replace</span><span class="p">(</span><span class="nx">trimRight</span><span class="p">,</span> <span class="s1">''</span><span class="p">).</span><span class="nx">toLowerCase</span><span class="p">();</span>
|
934
|
+
<span class="kd">var</span> <span class="nx">named</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
|
935
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">names</span><span class="p">[</span><span class="nx">color</span><span class="p">])</span> <span class="p">{</span>
|
936
|
+
<span class="nx">color</span> <span class="o">=</span> <span class="nx">names</span><span class="p">[</span><span class="nx">color</span><span class="p">];</span>
|
937
|
+
<span class="nx">named</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
|
938
|
+
<span class="p">}</span>
|
939
|
+
<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">color</span> <span class="o">==</span> <span class="s1">'transparent'</span><span class="p">)</span> <span class="p">{</span>
|
940
|
+
<span class="k">return</span> <span class="p">{</span> <span class="nx">r</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">g</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">b</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">a</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">format</span><span class="o">:</span> <span class="s2">"name"</span> <span class="p">};</span>
|
941
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-55"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-55">¶</a> </div> <p>Try to match string input using regular expressions.
|
942
|
+
Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
|
943
|
+
Just return an object and let the conversion functions handle that.
|
944
|
+
This way the result will be the same whether the tinycolor is initialized with string or object.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">match</span><span class="p">;</span>
|
945
|
+
<span class="k">if</span> <span class="p">((</span><span class="nx">match</span> <span class="o">=</span> <span class="nx">matchers</span><span class="p">.</span><span class="nx">rgb</span><span class="p">.</span><span class="nx">exec</span><span class="p">(</span><span class="nx">color</span><span class="p">)))</span> <span class="p">{</span>
|
946
|
+
<span class="k">return</span> <span class="p">{</span> <span class="nx">r</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="nx">g</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="nx">b</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="p">};</span>
|
947
|
+
<span class="p">}</span>
|
948
|
+
<span class="k">if</span> <span class="p">((</span><span class="nx">match</span> <span class="o">=</span> <span class="nx">matchers</span><span class="p">.</span><span class="nx">rgba</span><span class="p">.</span><span class="nx">exec</span><span class="p">(</span><span class="nx">color</span><span class="p">)))</span> <span class="p">{</span>
|
949
|
+
<span class="k">return</span> <span class="p">{</span> <span class="nx">r</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="nx">g</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="nx">b</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="nx">a</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">4</span><span class="p">]</span> <span class="p">};</span>
|
950
|
+
<span class="p">}</span>
|
951
|
+
<span class="k">if</span> <span class="p">((</span><span class="nx">match</span> <span class="o">=</span> <span class="nx">matchers</span><span class="p">.</span><span class="nx">hsl</span><span class="p">.</span><span class="nx">exec</span><span class="p">(</span><span class="nx">color</span><span class="p">)))</span> <span class="p">{</span>
|
952
|
+
<span class="k">return</span> <span class="p">{</span> <span class="nx">h</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="nx">l</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="p">};</span>
|
953
|
+
<span class="p">}</span>
|
954
|
+
<span class="k">if</span> <span class="p">((</span><span class="nx">match</span> <span class="o">=</span> <span class="nx">matchers</span><span class="p">.</span><span class="nx">hsla</span><span class="p">.</span><span class="nx">exec</span><span class="p">(</span><span class="nx">color</span><span class="p">)))</span> <span class="p">{</span>
|
955
|
+
<span class="k">return</span> <span class="p">{</span> <span class="nx">h</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="nx">l</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="nx">a</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">4</span><span class="p">]</span> <span class="p">};</span>
|
956
|
+
<span class="p">}</span>
|
957
|
+
<span class="k">if</span> <span class="p">((</span><span class="nx">match</span> <span class="o">=</span> <span class="nx">matchers</span><span class="p">.</span><span class="nx">hsv</span><span class="p">.</span><span class="nx">exec</span><span class="p">(</span><span class="nx">color</span><span class="p">)))</span> <span class="p">{</span>
|
958
|
+
<span class="k">return</span> <span class="p">{</span> <span class="nx">h</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="nx">v</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="p">};</span>
|
959
|
+
<span class="p">}</span>
|
960
|
+
<span class="k">if</span> <span class="p">((</span><span class="nx">match</span> <span class="o">=</span> <span class="nx">matchers</span><span class="p">.</span><span class="nx">hsva</span><span class="p">.</span><span class="nx">exec</span><span class="p">(</span><span class="nx">color</span><span class="p">)))</span> <span class="p">{</span>
|
961
|
+
<span class="k">return</span> <span class="p">{</span> <span class="nx">h</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="nx">s</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="nx">v</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="nx">a</span><span class="o">:</span> <span class="nx">match</span><span class="p">[</span><span class="mi">4</span><span class="p">]</span> <span class="p">};</span>
|
962
|
+
<span class="p">}</span>
|
963
|
+
<span class="k">if</span> <span class="p">((</span><span class="nx">match</span> <span class="o">=</span> <span class="nx">matchers</span><span class="p">.</span><span class="nx">hex8</span><span class="p">.</span><span class="nx">exec</span><span class="p">(</span><span class="nx">color</span><span class="p">)))</span> <span class="p">{</span>
|
964
|
+
<span class="k">return</span> <span class="p">{</span>
|
965
|
+
<span class="nx">r</span><span class="o">:</span> <span class="nx">parseIntFromHex</span><span class="p">(</span><span class="nx">match</span><span class="p">[</span><span class="mi">1</span><span class="p">]),</span>
|
966
|
+
<span class="nx">g</span><span class="o">:</span> <span class="nx">parseIntFromHex</span><span class="p">(</span><span class="nx">match</span><span class="p">[</span><span class="mi">2</span><span class="p">]),</span>
|
967
|
+
<span class="nx">b</span><span class="o">:</span> <span class="nx">parseIntFromHex</span><span class="p">(</span><span class="nx">match</span><span class="p">[</span><span class="mi">3</span><span class="p">]),</span>
|
968
|
+
<span class="nx">a</span><span class="o">:</span> <span class="nx">convertHexToDecimal</span><span class="p">(</span><span class="nx">match</span><span class="p">[</span><span class="mi">4</span><span class="p">]),</span>
|
969
|
+
<span class="nx">format</span><span class="o">:</span> <span class="nx">named</span> <span class="o">?</span> <span class="s2">"name"</span> <span class="o">:</span> <span class="s2">"hex8"</span>
|
970
|
+
<span class="p">};</span>
|
971
|
+
<span class="p">}</span>
|
972
|
+
<span class="k">if</span> <span class="p">((</span><span class="nx">match</span> <span class="o">=</span> <span class="nx">matchers</span><span class="p">.</span><span class="nx">hex6</span><span class="p">.</span><span class="nx">exec</span><span class="p">(</span><span class="nx">color</span><span class="p">)))</span> <span class="p">{</span>
|
973
|
+
<span class="k">return</span> <span class="p">{</span>
|
974
|
+
<span class="nx">r</span><span class="o">:</span> <span class="nx">parseIntFromHex</span><span class="p">(</span><span class="nx">match</span><span class="p">[</span><span class="mi">1</span><span class="p">]),</span>
|
975
|
+
<span class="nx">g</span><span class="o">:</span> <span class="nx">parseIntFromHex</span><span class="p">(</span><span class="nx">match</span><span class="p">[</span><span class="mi">2</span><span class="p">]),</span>
|
976
|
+
<span class="nx">b</span><span class="o">:</span> <span class="nx">parseIntFromHex</span><span class="p">(</span><span class="nx">match</span><span class="p">[</span><span class="mi">3</span><span class="p">]),</span>
|
977
|
+
<span class="nx">format</span><span class="o">:</span> <span class="nx">named</span> <span class="o">?</span> <span class="s2">"name"</span> <span class="o">:</span> <span class="s2">"hex"</span>
|
978
|
+
<span class="p">};</span>
|
979
|
+
<span class="p">}</span>
|
980
|
+
<span class="k">if</span> <span class="p">((</span><span class="nx">match</span> <span class="o">=</span> <span class="nx">matchers</span><span class="p">.</span><span class="nx">hex4</span><span class="p">.</span><span class="nx">exec</span><span class="p">(</span><span class="nx">color</span><span class="p">)))</span> <span class="p">{</span>
|
981
|
+
<span class="k">return</span> <span class="p">{</span>
|
982
|
+
<span class="nx">r</span><span class="o">:</span> <span class="nx">parseIntFromHex</span><span class="p">(</span><span class="nx">match</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="s1">''</span> <span class="o">+</span> <span class="nx">match</span><span class="p">[</span><span class="mi">1</span><span class="p">]),</span>
|
983
|
+
<span class="nx">g</span><span class="o">:</span> <span class="nx">parseIntFromHex</span><span class="p">(</span><span class="nx">match</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">+</span> <span class="s1">''</span> <span class="o">+</span> <span class="nx">match</span><span class="p">[</span><span class="mi">2</span><span class="p">]),</span>
|
984
|
+
<span class="nx">b</span><span class="o">:</span> <span class="nx">parseIntFromHex</span><span class="p">(</span><span class="nx">match</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">+</span> <span class="s1">''</span> <span class="o">+</span> <span class="nx">match</span><span class="p">[</span><span class="mi">3</span><span class="p">]),</span>
|
985
|
+
<span class="nx">a</span><span class="o">:</span> <span class="nx">convertHexToDecimal</span><span class="p">(</span><span class="nx">match</span><span class="p">[</span><span class="mi">4</span><span class="p">]</span> <span class="o">+</span> <span class="s1">''</span> <span class="o">+</span> <span class="nx">match</span><span class="p">[</span><span class="mi">4</span><span class="p">]),</span>
|
986
|
+
<span class="nx">format</span><span class="o">:</span> <span class="nx">named</span> <span class="o">?</span> <span class="s2">"name"</span> <span class="o">:</span> <span class="s2">"hex8"</span>
|
987
|
+
<span class="p">};</span>
|
988
|
+
<span class="p">}</span>
|
989
|
+
<span class="k">if</span> <span class="p">((</span><span class="nx">match</span> <span class="o">=</span> <span class="nx">matchers</span><span class="p">.</span><span class="nx">hex3</span><span class="p">.</span><span class="nx">exec</span><span class="p">(</span><span class="nx">color</span><span class="p">)))</span> <span class="p">{</span>
|
990
|
+
<span class="k">return</span> <span class="p">{</span>
|
991
|
+
<span class="nx">r</span><span class="o">:</span> <span class="nx">parseIntFromHex</span><span class="p">(</span><span class="nx">match</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="s1">''</span> <span class="o">+</span> <span class="nx">match</span><span class="p">[</span><span class="mi">1</span><span class="p">]),</span>
|
992
|
+
<span class="nx">g</span><span class="o">:</span> <span class="nx">parseIntFromHex</span><span class="p">(</span><span class="nx">match</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">+</span> <span class="s1">''</span> <span class="o">+</span> <span class="nx">match</span><span class="p">[</span><span class="mi">2</span><span class="p">]),</span>
|
993
|
+
<span class="nx">b</span><span class="o">:</span> <span class="nx">parseIntFromHex</span><span class="p">(</span><span class="nx">match</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">+</span> <span class="s1">''</span> <span class="o">+</span> <span class="nx">match</span><span class="p">[</span><span class="mi">3</span><span class="p">]),</span>
|
994
|
+
<span class="nx">format</span><span class="o">:</span> <span class="nx">named</span> <span class="o">?</span> <span class="s2">"name"</span> <span class="o">:</span> <span class="s2">"hex"</span>
|
995
|
+
<span class="p">};</span>
|
996
|
+
<span class="p">}</span>
|
997
|
+
|
998
|
+
<span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
|
999
|
+
<span class="p">}</span>
|
1000
|
+
|
1001
|
+
<span class="kd">function</span> <span class="nx">validateWCAG2Parms</span><span class="p">(</span><span class="nx">parms</span><span class="p">)</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-56"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-56">¶</a> </div> <p>return valid WCAG2 parms for isReadable.
|
1002
|
+
If input parms are invalid, return {"level":"AA", "size":"small"}</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">level</span><span class="p">,</span> <span class="nx">size</span><span class="p">;</span>
|
1003
|
+
<span class="nx">parms</span> <span class="o">=</span> <span class="nx">parms</span> <span class="o">||</span> <span class="p">{</span><span class="s2">"level"</span><span class="o">:</span><span class="s2">"AA"</span><span class="p">,</span> <span class="s2">"size"</span><span class="o">:</span><span class="s2">"small"</span><span class="p">};</span>
|
1004
|
+
<span class="nx">level</span> <span class="o">=</span> <span class="p">(</span><span class="nx">parms</span><span class="p">.</span><span class="nx">level</span> <span class="o">||</span> <span class="s2">"AA"</span><span class="p">).</span><span class="nx">toUpperCase</span><span class="p">();</span>
|
1005
|
+
<span class="nx">size</span> <span class="o">=</span> <span class="p">(</span><span class="nx">parms</span><span class="p">.</span><span class="nx">size</span> <span class="o">||</span> <span class="s2">"small"</span><span class="p">).</span><span class="nx">toLowerCase</span><span class="p">();</span>
|
1006
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">level</span> <span class="o">!==</span> <span class="s2">"AA"</span> <span class="o">&&</span> <span class="nx">level</span> <span class="o">!==</span> <span class="s2">"AAA"</span><span class="p">)</span> <span class="p">{</span>
|
1007
|
+
<span class="nx">level</span> <span class="o">=</span> <span class="s2">"AA"</span><span class="p">;</span>
|
1008
|
+
<span class="p">}</span>
|
1009
|
+
<span class="k">if</span> <span class="p">(</span><span class="nx">size</span> <span class="o">!==</span> <span class="s2">"small"</span> <span class="o">&&</span> <span class="nx">size</span> <span class="o">!==</span> <span class="s2">"large"</span><span class="p">)</span> <span class="p">{</span>
|
1010
|
+
<span class="nx">size</span> <span class="o">=</span> <span class="s2">"small"</span><span class="p">;</span>
|
1011
|
+
<span class="p">}</span>
|
1012
|
+
<span class="k">return</span> <span class="p">{</span><span class="s2">"level"</span><span class="o">:</span><span class="nx">level</span><span class="p">,</span> <span class="s2">"size"</span><span class="o">:</span><span class="nx">size</span><span class="p">};</span>
|
1013
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-57"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-57">¶</a> </div> <p>Node: Export function</p> </td> <td class="code"> <div class="highlight"><pre><span class="k">if</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">module</span> <span class="o">!==</span> <span class="s2">"undefined"</span> <span class="o">&&</span> <span class="nx">module</span><span class="p">.</span><span class="nx">exports</span><span class="p">)</span> <span class="p">{</span>
|
1014
|
+
<span class="nx">module</span><span class="p">.</span><span class="nx">exports</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">;</span>
|
1015
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-58"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-58">¶</a> </div> <p>AMD/requirejs: Define the module</p> </td> <td class="code"> <div class="highlight"><pre><span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">define</span> <span class="o">===</span> <span class="s1">'function'</span> <span class="o">&&</span> <span class="nx">define</span><span class="p">.</span><span class="nx">amd</span><span class="p">)</span> <span class="p">{</span>
|
1016
|
+
<span class="nx">define</span><span class="p">(</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span><span class="k">return</span> <span class="nx">tinycolor</span><span class="p">;});</span>
|
1017
|
+
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-59"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-59">¶</a> </div> <p>Browser: Expose to window</p> </td> <td class="code"> <div class="highlight"><pre><span class="k">else</span> <span class="p">{</span>
|
1018
|
+
<span class="nb">window</span><span class="p">.</span><span class="nx">tinycolor</span> <span class="o">=</span> <span class="nx">tinycolor</span><span class="p">;</span>
|
1019
|
+
<span class="p">}</span>
|
1020
|
+
|
1021
|
+
<span class="p">})(</span><span class="nb">Math</span><span class="p">);</span>
|
1022
|
+
|
1023
|
+
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
|