config redirect

This commit is contained in:
Nuno Coração
2023-01-29 22:30:24 +00:00
parent 17557c7d73
commit 5fb4bd8083
9905 changed files with 1258996 additions and 36355 deletions
+14
View File
@@ -0,0 +1,14 @@
/* IMPORT */
import _ from '../utils/index.js';
import luminance from './luminance.js';
/* MAIN */
const contrast = (color1, color2) => {
const luminance1 = luminance(color1);
const luminance2 = luminance(color2);
const max = Math.max(luminance1, luminance2);
const min = Math.min(luminance1, luminance2);
const ratio = (max + Number.EPSILON) / (min + Number.EPSILON);
return _.lang.round(_.lang.clamp(ratio, 1, 10));
};
/* EXPORT */
export default contrast;