Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Get all NBA team's color code (Hex or RGB).
Useful for building NBA-related colorful product.
$ npm install nba-color
or
$ yarn add nba-color
import chalk from 'chalk';
import { getMainColor, getFullName } from 'nba-color';
const warriors = 'GSW';
const { hex: warriorsColorHex } = getMainColor(warriors);
const warriorsFullName = getFullName(warriors);
console.log(chalk.bgHex(warriorsColorHex).bold(warriorsFullName));
result:
getAllColors()
=> Object
Return an Object
containing all NBA teams colors data.
The object's keys are uppercase Team Abbreviations.
getMainColor(teamAbbreviation)
=> Object
Parameter: String
It can 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
import { getMainColor } from 'nba-color';
console.log(getMainColor('CLE'));
/*
{
hex: '#6f263d',
rgb: [111, 38, 61]
}
*/
getSecondaryColor(teamAbbreviation)
=> Object
Parameter: String
It can be uppercase or lowercase Team Abbreviations.
Return: Object
Contain the NBA team secondary color's Hexadecimal Colors Code and RGB Color Code.
Note.
If received an excluded team abbreviation, return undefined
.
Example
import { getSecondaryColor } from 'nba-color';
console.log(getSecondaryColor('NYK'));
/*
{
hex: '#ff671f',
rgb: [255, 103, 31],
}
*/
getColors(teamAbbreviation)
=> 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
import { getColors } from '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],
}
}
*/
getColorsList(teamAbbreviation)
=> 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
import { getColorsList } from 'nba-color';
console.log(getColorsList('LAL'));
/*
['purple', 'gold', 'white']
*/
getFullName(teamAbbreviation)
=> 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
import { getFullName } from 'nba-color';
console.log(getFullName('SAS'));
/*
'San Antonio Spurs'
*/
MIT © xxhomey19
FAQs
Get NBA team's color.
The npm package nba-color receives a total of 5 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.