code: static double contrast( double color, double dark, double light, double threshold ) {
          //Figure out which is actually light and dark!
          if( luma( dark ) > luma( light ) ) {
              double t = light;
              light = dark;
              dark = t;
          }
          if( luma( color ) < threshold ) {
              return light;
          } else {
              return dark;
          }
      }
docs: The less function "contrast".
  
  @param color
  a color value as long
  @param dark
  a designated dark color
  @param light
  a designated light color
  @param threshold
  percentage 0-100% specifying where the transition from "dark" to "light" is
  @return a color value as long