break out scale rgb into its own file, parses colors

This commit is contained in:
Colin Megill
2018-04-18 00:29:32 -07:00
parent 6bf5b66fea
commit 9e3ca5c30b
+10
View File
@@ -0,0 +1,10 @@
export const scaleRGB = (input) => {
const outputMax = 1;
const outputMin = 0;
const inputMax = 255;
const inputMin = 0;
const percent = (input - inputMin) / (inputMax - inputMin);
return percent * (outputMax - outputMin) + outputMin;
}