mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-07 06:48:11 +08:00
break out scale rgb into its own file, parses colors
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user