Overwatch League Colors
Retrieves Overwatch League team colors!
About
This module retrieves the official RGB and hexadecimal color codes for all Overwatch League teams. Each team has a primary color, secondary color, and tertiary color used for their official branding. This is a useful module to use for building visual Overwatch League projects.
Installation
$ npm install owl-colors
Example Usage
// We'll use chalk for displaying color on the consoleconst chalk = ;const getPrimaryColor getTeamName = ; // Uses the official team abbreviation for // Boston Uprising to get the primary hex colorconst bostonUprising = 'BOS';const hex: uprisingColors = ; // finds Boston Uprising's official team name// and displays it on the consoleconst name = ;console;
Results:
Example Usage with Node Canvas
Here's an example images used to generate these banners similar to those found on https://overwatchleague.com during live matches.
Lets recreate the promotional banner for the match between Paris Eternal and Atlanta Reign (logo code omitted):
const createCanvas loadImage = ;const getPrimaryColor getSecondaryColor = ; // We'll initialize our canvas variables hereconst canvas = ;const ctx = canvas;let width = 150 height = 150;let side1 = 20 side2 = 20; // gets the primary and secondary // hex colors for Paris Eternalconst parisPrimary = hex;const parisSecondary = hex; // same thing for Atlanta Reignconst atlPrimary = hex;const atlSecondary = hex; // We'll draw our canvas here.// NOTE: logo code is ommitted here for relevancectxfillStyle = parisPrimary;ctx; ctxfillStyle = atlPrimary;ctx; // we add our secondary collor// accents here on the sides of the bannerctxfillStyle = parisSecondary;ctx; ctxfillStyle = atlSecondary;ctx;
Results:
API
getAllColors()
Retrieves all Overwatch League Colors
Returns:
Object
an Object containing all color data for all Overwatch League teams. All object keys use 3 letter team abbreviation
abbreviatedName)
getPrimaryColor(Retrieves a team's primary color.
Parameter:
string
an Overwatch League team name abbreviation (uppercase or lowercase)Returns:
Object
an Object containing primary color data for a specified Overwatch League Team. All object keys use 3 letter team abbreviation, orundefined
if passed an improper team abbreviation.
Example
const getPrimaryColor = ; // Los Angeles Valiant team abbreviationconsole;
Output
hex: '#004438' rgb: 0 68 56
abbreviatedName)
getSecondaryColor(Retrieves a team's secondary color.
Parameter:
string
an Overwatch League team name abbreviation (uppercase or lowercase)Returns:
Object
an Object containing secondary color data for a specified Overwatch League Team. All object keys use 3 letter team abbreviation, orundefined
if passed an improper team abbreviation.
Example
const getSecondaryColor = ; // Paris Eternal team abbreviationconsole;
Output
hex: '#8D042D' rgb: 141 4 45
abbreviatedName)
getTertiaryColor(Retrieves a team's tertiary color.
Parameter:
string
an Overwatch League team name abbreviation (uppercase or lowercase)Returns:
Object
an Object containing tertiary color data for a specified Overwatch League Team. All object keys use 3 letter team abbreviation, orundefined
if passed an improper team abbreviation.
Example
const getTertiaryColor = ; // Los Angeles Gladiators team abbreviationconsole;
Output
hex: '#ffffff' rgb: 255 255 255
abbreviatedName)
getColors(Retrieves all colors from a specific Overwatch League team.
Parameter:
string
an Overwatch League team name abbreviation (uppercase or lowercase)Returns:
Object
an Object containing all hex and RGB color data for a specified Overwatch League Team. All object keys use 3 letter team abbreviation, orundefined
if passed an improper team abbreviation.
Example
const getColors = ; // San Francisco Shock team abbreviationconsole;
Output
gray: hex: '#75787B' rgb: 117 120 123 orange: hex: '#FC4C02' rgb: 252 76 2 gold: hex: '#CAB64B' rgb: 202 182 75
abbreviatedName)
getTeamName(Retrieves a team's full name.
Parameter:
string
an Overwatch League team name abbreviation (uppercase or lowercase)Returns:
string
an Overwatch League team's full name, orundefined
if passed an improper team abbreviation.
Example
const getTeamName = ; // London Spitfire team abbreviationconsole;
Output
London Spitfire
abbreviatedName)
getColorList(Retrieves a list of a team's main branding colors
Parameter:
string
an Overwatch League team name abbreviation (uppercase or lowercase)Returns:
string[]
a list of an Overwatch League team's color names orundefined
if passed an improper team abbreviation.
Example
const getColorList = ; // Shanghai Dragons team abbreviationconsole;
Output
'red' 'black' 'yellow'