Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Get all NBA team's color code (Hex or RGB).
Useful for building NBA-related colorful product.
$ npm install nba-color
const chalk = require('chalk');
const { getMainColor, getFullName } = require('nba-color');
const warriors = 'GSW';
const { hex: warriorsColorHex } = getMainColor(warriors);
const warriorsFullName = getFullName(warriors);
console.log(chalk.bgHex(warriorsColorHex).bold(warriorsFullName));
result:
Object
Return an Object
containing all NBA teams colors data.
The object's keys are uppercase Team Abbreviations.
Object
Parameter: String
It be uppercase or lowercase Team Abbreviations.
Return: Object
Contain the NBA team main color's Hexadecimal Colors Code and RGB Color Code.
Note.
If received an excluded team abbreviation, return undefined
.
Example
const { getMainColor } = require('nba-color');
console.log(getMainColor('CLE'));
/*
{
hex: '#6f263d',
rgb: [111, 38, 61]
}
*/
Object
Parameter: String
It can be uppercase or lowercase Team Abbreviations.
Return: Object
Contain the NBA team all colors, including Hexadecimal Colors Code and RGB Color Code for each color.
Note.
If received an excluded team abbreviation, return undefined
.
Example
const { getColors } = require('nba-color');
console.log(getColors('LAL'));
/*
{
purple: {
hex: '#702f8a',
rgb: [112, 47, 138],
},
gold: {
hex: '#ffc72c',
rgb: [255, 199, 44],
},
white: {
hex: '#ffffff',
rgb: [255, 255, 255],
}
}
*/
Array
Parameter: String
It can be uppercase or lowercase Team Abbreviations.
Return: Array
Contain the NBA team colors.
Note.
If received an excluded team abbreviation, return undefined
.
Example
const { getColorsList } = require('nba-color');
console.log(getColorsList('LAL'));
/*
['purple', 'gold', 'white']
*/
String
Parameter: String
It can be uppercase or lowercase Team Abbreviations.
Return: String
The NBA team full name.
Note.
If received an excluded team abbreviation, return undefined
.
Example
const { getFullName } = require('nba-color');
console.log(getFullName('SAS'));
/*
'San Antonio Spurs'
*/
MIT
FAQs
Get NBA team's color.
The npm package nba-color receives a total of 11 weekly downloads. As such, nba-color popularity was classified as not popular.
We found that nba-color demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.