Language-Flag-Colors
A package with the color of every language's flag
Instalation
npm install language-flag-colors
yarn add language-flag-colors
Usage
Importing
TypeScript
import languages, { getLanguage } from "language-flag-colors";
JavaScript
const { getLanguage, default: languages } = require("language-flag-colors");
Or, if you only want the default array export
const languages = require("language-flag-colors");
Or if you only want a function
const { getLanguage } = require("language-flag-colors");
Using our custom methods
const dutch = getLanguage("Dutch");
const portuguese = getLanguage("pt-pt");
const [dutch, portuguese] = getLanguage(["nl-nl", "portuguese"]);
const ptName = getName("pt-pt");
const ptNativeName = getNativeName("pt-pt");
const dutchIds = getIds("nld");
const dutchLocale = getLocale("dutch");
const ptISO_639_1 = getISO_639_1("PORTUGUESE");
const dutchISO_639_2 = getISO_639_2("dutch");
const englishISO_639_3 = getISO_639_3("English");
const ptAndroidCode = getAndroidCode("PORTUGUESE");
const dutchOSXCode = getOSXCode("nl-nl");
const englishOSXLocale = getOSXLocale("eng");
const ptGlottologUrl = getGlottolog("pt-pt", true);
const dutchGlottologId = getGlottolog("nl-nl");
const dutchDirection = getDirection("Dutch");
const arabicDirection = getDirection("ar");
const ptCountry = getCountry("pt");
const dutchCountryCode = getCountryCode("dutch");
const netherlandsLangs = getCountryLanguages("netherlands");
const ptFlag = getFlag("pt");
const dutchFlagImage = getImage("nl");
const ptEmoji = getEmoji("pt-pt");
const dutchEmoji = getEmoji("dutch");
const ukEmoji = getEmoji("United Kingdom");
const usEmoji = getEmoji("us");
const ptPrimaryColor = getPrimaryColor("pt");
const ptPrimaryHex = getPrimaryHex("pt-pt");
const dutchPrimaryHex = getPrimaryHex("dutch");
const ptPrimaryRGB = getPrimaryRGB("pt-pt");
const dutchPrimaryRGB = getPrimaryRGB("dutch");
const ptPrimaryCMYK = getPrimaryCMYK("pt-pt");
const dutchPrimaryCMYK = getPrimaryCMYK("dutch");
const ptPrimaryBase10 = getPrimaryBase10("pt-pt");
const dutchPrimaryBase10 = getPrimaryBase10("dutch");
const dutchFlagColors = getFlagColors("nl");
const ptHexFlagColors = getHexFlagColors("pt-pt");
const dutchHexFlagColors = getHexFlagColors("dutch");
const ptRGBFlagColors = getRGBFlagColors("pt-pt");
const dutchRGBFlagColors = getRGBFlagColors("dutch");
const ptCMYKFlagColors = getCMYKFlagColors("pt-pt");
const dutchCMYKFlagColors = getCMYKFlagColors("dutch");
const ptBase10FlagColors = getBase10FlagColors("pt-pt");
const dutchBase10FlagColors = getBase10FlagColors("dutch");
const sardinianRegion = getRegion("Sardinian");
const basqueRegionCode = getRegionCode("eu-ES");
const scotlandLangs = getRegionLanguages("scotland");
Contributing
Due to the large amount of languages we support in this package, it is possible that some information may be inaccurate. If you believe so, feel free to open a pull request.
Inspiration
We got all the language names and locale from Crowdin's officially supported languages (with some minor differences) and added all the colors, countries and regions manually. We hope to keep this list updated whenever they add new languages, but we may also add other ones not supported by them if these are requested by anyone. This package was created by Bas950 and Rodry and is not officially endorsed by Crowdin nor affiliated with the company in any way.