Skip to content

Instantly share code, notes, and snippets.

View luisangelorjr's full-sized avatar
🖖
Focusing

Luís Ângelo Rodrigues Jr. luisangelorjr

🖖
Focusing
View GitHub Profile
@luisangelorjr
luisangelorjr / getAverageColourAsRGB.js
Created May 9, 2018 19:55 — forked from olvado/getAverageColourAsRGB.js
Get the average colour of an image in javascript using getImageData in CANVAS
function getAverageColourAsRGB (img) {
var canvas = document.createElement('canvas'),
context = canvas.getContext && canvas.getContext('2d'),
rgb = {r:102,g:102,b:102}, // Set a base colour as a fallback for non-compliant browsers
pixelInterval = 5, // Rather than inspect every single pixel in the image inspect every 5th pixel
count = 0,
i = -4,
data, length;
// return the base colour for non-compliant browsers
@luisangelorjr
luisangelorjr / README-Template.md
Created April 1, 2018 00:06 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites