Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Image upload handler
$('#upload').change(function () {
const file = this.files[0];
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function () {
$('body').css('background-image', 'url("' + reader.result + '")');
$('#colors').html('<h2>Processing...</h2>');
getColors(reader.result.substr(reader.result.search('base64,') + 7));
};
reader.onerror = function (error) {
console.error('Error: ', error);
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.