Skip to content

tfrere/colours-in-culture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Colours in culture

Get cultural meanings from all around the world. Based on the excellent work of David McCandless.

Demo

HOW TO USE

var ColoursInCulture = require("colours-in-culture");

var result = ColoursInCulture.getCultureColorFeelings("#7c7b7a", "japanese");
console.log(result);

/**
 * Outputs :
 *
 * {
 *   closestColor: {
 *     hex: "#7c7b7a",
 *     name: "grey"
 *   },
 *   cultureFeelings: [
 *      "staid,
 *      "intelligence",
 *      "reliability",
 *      "old age",
 *      "conservative",
 *      "modesty"
 *    ]
 *  }
 */

Future version ( not yet implemented )

API

Get color list

Return list of all colors in database

Sorted by count of associated concepts in all cultures

api.getColorList() -> ["color"]

// Example
// api.getColorList() = ["blue", "red", "green", ...];

Get closest color

Return closest color found in database from a given hex

Sorted by count of associated concepts in all cultures

api.getClosestColor("hex") -> "color"
// Example
// api.getClosestColor("mourning") = [{"westernAmerican": ["blue", "red"]}];

Search by color

Return list of cultures and their associated concepts

Sorted by count of associated concepts in all cultures

api.searchByColor("color") -> [{"culture": ["concept"]}];

// Example
// api.searchByColor("blue") = [{"westernAmerican": ["mourning", "glory"]}];

Get culture list

Return list of all cultures in database

Sorted by count of associated concepts for all colors

// sort by : nombre de concepts associés toutes cultures confondues

api.getCultureList() -> ["culture"]
// Example
// api.getCultureList() = ["westernAmerican", "asian"];

Search by culture

Return list of colors and their associated concepts

Sorted by count of associated concepts for all colors

api.searchByCulture("culture") -> [{"color": ["concept"]} | null
// Example
// api.searchByColor("westernAmerican") = [{"blue": ["mourning", "glory"]}];

Get concept list

Return list of all concepts in database

Sorted by count of associated colors for all cultures

api.getConceptList() -> ["concept"]
// Example
// api.getConceptList() = ["love", "passion"]

Search by concept

Return list of cultures and their associated colors

Sorted by count of associated concepts for all colors

api.searchByCulture("concept") -> [{"culture": ["color"]} | null
// Example
// api.searchByColor("mourning") = [{"westernAmerican": ["blue", "red"]}];

Get dominant color by concept

Return Color that is massively associated to a given concept

api.getDominantColorByConcept("concept") -> "color" | null
// Example
// api.getDominantColorByConcept("mourning") = [{"westernAmerican": ["blue", "red"]}];

Sources

Contribute

Feel free to send me an e-mail or submit a pull request. To be validated, please consider adding some sources to your additionnal informations.

Data file

Licence

Released under the MIT License

About

Get the cultural meanings for a given color.

Resources

License

Stars

Watchers

Forks

Packages

No packages published