diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..32c105d
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+demos/* linguist-documentation
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 0000000..782dc14
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 702858b..e32c00e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,13 @@
node_modules
_site/
+
+### JetBrains template
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
+
+*.iml
+
+## Directory-based project format:
+.idea/
+
+
+
diff --git a/.lgtm b/.lgtm
new file mode 100644
index 0000000..7197dee
--- /dev/null
+++ b/.lgtm
@@ -0,0 +1,3 @@
+approvals = 1
+pattern = "(?i):shipit:|:\\+1:|LGTM"
+
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..65df7fe
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,67 @@
+# Contribute
+
+## Introduction
+
+First, thank you for considering contributing to jquery-adaptive-backgrounds! It's people like you that make the open source community such a great community! 😊
+
+We welcome any type of contribution, not only code. You can help with
+- **QA**: file bug reports, the more details you can give the better (e.g. screenshots with the console open)
+- **Marketing**: writing blog posts, howto's, printing stickers, ...
+- **Community**: presenting the project at meetups, organizing a dedicated meetup for the local community, ...
+- **Code**: take a look at the [open issues](issues). Even if you can't write code, commenting on them, showing that you care about a given issue matters. It helps us triage them.
+- **Money**: we welcome financial contributions in full transparency on our [open collective](https://opencollective.com/jquery-adaptive-backgrounds).
+
+## Your First Contribution
+
+Working on your first Pull Request? You can learn how from this *free* series, [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
+
+## Submitting code
+
+Any code change should be submitted as a pull request. The description should explain what the code does and give steps to execute it. The pull request should also contain tests.
+
+## Code review process
+
+The bigger the pull request, the longer it will take to review and merge. Try to break down large pull requests in smaller chunks that are easier to review and merge.
+It is also always helpful to have some context for your pull request. What was the purpose? Why does it matter to you?
+
+## Financial contributions
+
+We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/jquery-adaptive-backgrounds).
+Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed.
+
+## Questions
+
+If you have any questions, create an [issue](issue) (protip: do a quick search first to see if someone else didn't ask the same question before!).
+You can also reach us at hello@jquery-adaptive-backgrounds.opencollective.com.
+
+## Credits
+
+### Contributors
+
+Thank you to all the people who have already contributed to jquery-adaptive-backgrounds!
+
+
+
+### Backers
+
+Thank you to all our backers! [[Become a backer](https://opencollective.com/jquery-adaptive-backgrounds#backer)]
+
+
+
+
+### Sponsors
+
+Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/jquery-adaptive-backgrounds#sponsor))
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MAINTAINERS b/MAINTAINERS
new file mode 100644
index 0000000..acd6204
--- /dev/null
+++ b/MAINTAINERS
@@ -0,0 +1,2 @@
+briangonzalez
+sstern6
diff --git a/README.md b/README.md
index a7d07dc..59cd01c 100644
--- a/README.md
+++ b/README.md
@@ -1,28 +1,39 @@
-
-
-
+
-jquery.adaptive-backgrounds.js
-------------------------------
+> jquery.adaptive-backgrounds.js
_A simple jQuery plugin to extract the dominant color of an image and apply it to the background of its parent element._
**[Check it out on the web!](http://briangonzalez.github.io/jquery.adaptive-backgrounds.js/)**
+[![OpenCollective Backers][backer-badge]][backer-url] [![OpenCollective Sponsors][sponsor-badge]][sponsor-url]
+
+[backer-url]: #backers
+[backer-badge]: https://opencollective.com/jquery-adaptive-background/backers/badge.svg
+[sponsor-url]: #sponsors
+[sponsor-badge]: https://opencollective.com/jquery-adaptive-background/sponsors/badge.svg
+
Getting Started
------------------
-Simply include jQuery and the __[script](https://raw2.github.com/briangonzalez/jquery.adaptive-backgrounds.js/master/src/jquery.adaptive-backgrounds.js)__ in your page, then run the script like so:
+
+Install via bower:
+
+```
+bower install --save adaptive.background
+```
+
+Then simply include jQuery and the script in your page, and invoke it like so:
```javascript
$(document).ready(function(){
- $.adaptiveBackground.run()
+ $.adaptiveBackground.run();
});
```
The script looks for image(s) with the `data-adaptive-background` attribute:
```html
-
+
```
### Using an element with a CSS background image
@@ -32,12 +43,15 @@ Instead of using an `
` element nested inside of parent element, AB supports
Enable this functionality by adding a data property, `data-ab-css-background` to the element. See the example below:
```html
-
+
```
Demo
-----------
Here's a little demo of how it works. (1) The page loads (2) the dominant background color of the image is extracted (3) said color is applied to parent of image. _Demo drastically slowed down to show effect_.
+
+---
+
API
@@ -49,8 +63,12 @@ Default Options
----------------
- __selector__ String _(default: `'img[data-adaptive-background="1"]'`)_ a CSS selector which denotes which images to grab/process. Ideally, this selector would start with _img_, to ensure we only grab and try to process actual images.
- __parent__ falsy _(default: `null`)_ a CSS selector which denotes which parent to apply the background color to. By default, the color is applied to the parent one level up the DOM tree.
-- __normalizeTextColor__ boolean _(default: `false`)_ option to normalize the color of the parent text if background color is too dark or too light
-- __normalizedTextColors__ Object Literal _(default: `{dark: '#000', light: '#fff'}`)_ text colors used when background is either too dark/light
+- __normalizeTextColor__ boolean _(default: `false`)_ option to normalize the color of the parent text if background color is too dark or too light.
+- __normalizedTextColors__ Object Literal _(default: `{dark: '#000', light: '#fff'}`)_ text colors used when background is either too dark/light.
+- __shadeVariation__ `blend|true|false` (default) option to shade the color of the parent ligher or darker (see shadePercentage) or blend the color of the parent with another color by a certain percentage (see shadeColors).
+- __shadePercentage__ float (default: `0`) sets the percentage of shading or blending used. Can be adjusted from -1.00 to 1.00.
+- __shadeColors__ Object Literal ( default: `{light:'rgb(255,255,255)',dark:'rgb(0,0,0)'}` ) sets the color that will be used to blend the background color with. Two values are provided to account for the background color to be light or dark to start with.
+- __transparent__ Transparent dominant color. Can be adjusted from 0.01 to 0.99.
__Example:__
@@ -61,6 +79,12 @@ var defaults = {
selector: '[data-adaptive-background="1"]',
parent: null,
exclude: [ 'rgb(0,0,0)', 'rgba(255,255,255)' ],
+ shadeVariation: false,
+ shadePercentage: 0,
+ shadeColors: {
+ light: 'rgb(255,255,255)',
+ dark: 'rgb(0,0,0)'
+ },
normalizeTextColor: false,
normalizedTextColors: {
light: "#fff",
@@ -69,7 +93,8 @@ var defaults = {
lumaClasses: {
light: "ab-light",
dark: "ab-dark"
- }
+ },
+ transparent: null
};
$.adaptiveBackground.run(defaults)
```
@@ -120,19 +145,51 @@ To enable CORS for images hosted on S3 buckets, follow the Amazon guide [here](h
For all images, you can optionally also include a cross-origin attribute in your image. This is not absolutely necessary since the `anonymous` origin is set in the Javascript code, but kudos to you for being a super-developer.
```html
-
+
```
Credit
------
This plugin is built on top of a script called [RGBaster](https://github.com/briangonzalez/rgbaster.js).
-Author
+Collaborators
-------
-|  |
-|---|
-| [Brian Gonzalez](http://briangonzalez.org) |
+|  |  | 
+|---|---|---|
+| [Brian Gonzalez](http://briangonzalez.org) | [Scott Stern](https://github.com/sstern6) | [Alfred J Kwack ](https://github.com/AlfredJKwack)|
+
+This project exists thanks to all the people who contribute. [[Contribute]](CONTRIBUTING.md).
+
+
+## Backers
+
+Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/jquery-adaptive-backgrounds#backer)]
+
+
+
+
+## Sponsors
+
+Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/jquery-adaptive-backgrounds#sponsor)]
+
+
+
+
+
+
+
+
+
+
+
License
-------
MIT, yo.
+
+
+
+
+
+
+
diff --git a/Termfile b/Termfile
index 2d9e086..8769c5d 100644
--- a/Termfile
+++ b/Termfile
@@ -1,5 +1,5 @@
root:
- ~/code/github/jquery.adaptive-backgrounds.js
+ ~/code/projects/jquery.adaptive-backgrounds.js
commands:
git: git st
diff --git a/bower.json b/bower.json
new file mode 100644
index 0000000..61ef8e1
--- /dev/null
+++ b/bower.json
@@ -0,0 +1,22 @@
+{
+ "name": "jquery.adaptive-backgrounds.js",
+ "version": "1.0.3",
+ "homepage": "https://github.com/briangonzalez/jquery.adaptive-backgrounds.js",
+ "authors": [
+ "Brian Gonzalez "
+ ],
+ "description": "A jQuery plugin for extracting the dominant color from images and applying the color to their parent. http://briangonzalez.github.io/jquery.adaptive-backgrounds.js/",
+ "main": "src/jquery.adaptive-backgrounds.js",
+ "moduleType": [
+ "globals"
+ ],
+ "keywords": [
+ "jquery",
+ "adaptive",
+ "background",
+ "color",
+ "image",
+ "processing"
+ ],
+ "license": "MIT"
+}
diff --git a/demos/adaptive-text.html b/demos/adaptive-text.html
index 27da99d..467cef9 100644
--- a/demos/adaptive-text.html
+++ b/demos/adaptive-text.html
@@ -15,7 +15,7 @@
-
-
-
-
-
-
-

-
-
-
-

-
-
-
-

-
-
-
-

-
-
-
-

-
-
-
-

-
-
-
-

-
-
-
-

-
-
-
-

-
-
-
-

-
-
-
-

-
-
-
-

-
-
-
-

-
-
-
-
-