<commit_before>/**
 * Module dependencies
 */
var colors = require('./colors')

var cssColors = colors.filter(function(color){
  return !! color.css
})

var vgaColors = colors.filter(function(color){
  return !! color.vga
})


/**
 * Get color value for a certain name.
 * @param name {String}
 * @return {String} Hex color value
 * @api public
 */

module.exports = function(name) {
  return module.exports.get(name).value
}

/**
 * Get color object.
 *
 * @param name {String}
 * @return {Object} Color object
 * @api public
 */

module.exports.get = function(name) {
  name = name || ''
  name = name.trim()
  return colors.filter(function(color){
    return color.name === name
  }).pop()
}

/**
 * Get all color object.
 *
 * @return {Array}
 * @api public<commit_msg>Prevent error if color not exist.<commit_after>/**
 * Module dependencies
 */
var colors = require('./colors')

var cssColors = colors.filter(function(color){
  return !! color.css
})

var vgaColors = colors.filter(function(color){
  return !! color.vga
})


/**
 * Get color value for a certain name.
 * @param name {String}
 * @return {String} Hex color value
 * @api public
 */

module.exports = function(name) {
  var color = module.exports.get(name)
  return color && color.value
}

/**
 * Get color object.
 *
 * @param name {String}
 * @return {Object} Color object
 * @api public
 */

module.exports.get = function(name) {
  name = name || ''
  name = name.trim()
  return colors.filter(function(color){
    return color.name === name
  }).pop()
}

/**
 * Get all color object.
 *
 * @return {Array}
 * @api public
{'fraction_non_alphanumeric': 0.16050156739811913, 'fraction_numerical': 0.0, 'mean_word_length': 3.372602739726027, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5020042', 'n_tokens_mistral': 514, 'n_tokens_neox': 513, 'n_words': 146}