ソースを参照

add another correction for lower lightness

Kirk Trombley 3 年 前
コミット
742051aab1
1 ファイル変更1 行追加1 行削除
  1. 1 1
      web/convert.js

+ 1 - 1
web/convert.js

@@ -20,7 +20,7 @@ const buildVectorData = (vector, toHue, toLightness, toChroma, toHex) => {
 
 const calcImportance = (chroma, lightness, proportion) => 
   chroma // used linearly
-  - Math.abs((lightness / 0.75) - 1) // reduce contribution for overly light color - probably a highlight
+  - Math.abs((Math.max(0.4, lightness) / 0.75) - 1) // reduce contribution for overly light color - probably a highlight - and increase for low light
   + 0.5 * Math.tanh(10 * (proportion - 0.25)) // steep ramp centered around 25%
 
 const buildClusterData = (size, inertia, mu1, mu2, mu3, nu1, nu2, nu3, totalSize, toHue, toLightness, toChroma, toHex) => {