import { Effects , ColorRange } from './const' ; export function transformValueToRange ( x , oldMin , oldMax , newMin , newMax ) { let newX = newMin + ( ( newMax - newMin ) / ( oldMax - oldMin ) ) * ( x - oldMin ) ; newX = Math . max ( newX , newMin ) ; newX = Math . min ( newX , newMax ) ; return newX ; } export function isEffectSet ( effect ) { return effect !== undefined && effect !== null ; } export function isAnyEffectSet ( effects ) { return Object . values ( effects ) . some ( e => isEffectSet ( e ) ) ; }