Skip to content

Instantly share code, notes, and snippets.

👨‍💻
🎸 🎮 🍺

Vaibhav Rathore rathorevaibhav

View GitHub Profile
@rathorevaibhav
rathorevaibhav / gist:34ff9bdbbd0faeb2f9bdd86dec0fb3cf
Last active Apr 17, 2018 — forked from babakhani/gist:9852598
get array of color between two colors
View gist:34ff9bdbbd0faeb2f9bdd86dec0fb3cf
function hexToRgb(hex){
var r, g, b, parts;
hex = hex.replace('#', '');
if(hex.length !== 3 && hex.length !== 6){
return [255,255,255];
}
if(hex.length == 3){
hex = hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2];
}
r = parseInt(hex.substr(0, 2), 16);
You can’t perform that action at this time.