ui/js/components/color-contrast.js
function isDark (r, g, b) {
  /**
   * W3C perceived brightness calculator
   * @see {@link https://www.w3.org/TR/AERT/#color-contrast}
   */
  const brightness = ((r * 299) + (g * 587) + (b * 114)) / 1000

  if (brightness < 140) {
    return true
  }

  return false
}
function isDark (r, g, b) {
  /**
   * W3C perceived brightness calculator
   * @see {@link https://www.w3.org/TR/AERT/#color-contrast}
   */
  const brightness = ((r * 299) + (g * 587) + (b * 114)) / 1000

  if (brightness < 140) {
    return true
  }

  return false
}
function isDark ( r , g , b ) { /**
   * W3C perceived brightness calculator
   * @see {@link https://www.w3.org/TR/AERT/#color-contrast}
   */ const brightness = ( ( r * 299 ) + ( g * 587 ) + ( b * 114 ) ) / 1000 if ( brightness < 140 ) { return true } return false }
Color is dark
@param {Number} r Red
@param {Number} g Green
@param {Number} b Blue
@returns {Boolean} Is dark
Color is dark