Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Colors #17

Open
wants to merge 13 commits into
base: travis
Choose a base branch
from
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "owl-colors",
"version": "0.0.9",
"version": "0.0.11",
"description": "Get Overwatch League team colors",
"main": "lib/owl-colors.js",
"files": [
Expand Down
18 changes: 13 additions & 5 deletions src/__tests__/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import Joi from 'joi';
import {
mainSchema, colorSchema, colorsSchema, colorsListSchema,
mainSchema,
colorSchema,
colorsSchema,
colorsListSchema,
} from './schema';
import {
getAllColors, getPrimaryColor, getSecondaryColor, getTertiaryColor, getColors,
getColorList, getTeamName,
getAllColors,
getPrimaryColor,
getSecondaryColor,
getTertiaryColor,
getColors,
getColorList,
getTeamName,
} from '..';

describe('OwlColor', () => {
Expand Down Expand Up @@ -119,7 +127,7 @@ describe('OwlColor', () => {
rgb: [3, 35, 64],
},
strongBlue: {
hex: '#0072ce',
hex: '#0072CE',
rgb: [0, 114, 206],
},
gray: {
Expand All @@ -139,7 +147,7 @@ describe('OwlColor', () => {
rgb: [3, 35, 64],
},
strongBlue: {
hex: '#0072ce',
hex: '#0072CE',
rgb: [0, 114, 206],
},
gray: {
Expand Down
60 changes: 28 additions & 32 deletions src/colors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const pureWhite = {
hex: '#ffffff',
rgb: [255, 255, 255],
Expand All @@ -23,7 +22,7 @@ const colors = {
rgb: [3, 35, 64],
},
strongBlue: {
hex: '#0072ce',
hex: '#0072CE',
rgb: [0, 114, 206],
},
gray: {
Expand Down Expand Up @@ -91,19 +90,19 @@ const colors = {
},
FLA: {
fullName: 'Florida Mayhem',
primaryColor: 'yellow',
secondaryColor: 'darkRed',
tertiaryColor: 'black',
primaryColor: 'black',
secondaryColor: 'pink',
tertiaryColor: 'blue',
colors: {
yellow: {
hex: '#FEDB00',
rgb: [254, 219, 0],
black: pureBlack,
pink: {
hex: '#CF4691',
rgb: [207, 70, 145],
},
darkRed: {
hex: '#AF272F',
rgb: [175, 39, 47],
blue: {
hex: '#3DB2E3',
rgb: [61, 178, 227],
},
black: pureBlack,
},
},
GLA: {
Expand Down Expand Up @@ -142,8 +141,8 @@ const colors = {
},
HOU: {
fullName: 'Houston Outlaws',
primaryColor: 'green',
secondaryColor: 'black',
primaryColor: 'black',
secondaryColor: 'green',
tertiaryColor: 'white',
colors: {
green: {
Expand Down Expand Up @@ -264,22 +263,19 @@ const colors = {
},
SFS: {
fullName: 'San Francisco Shock',
primaryColor: 'gray',
secondaryColor: 'orange',
tertiaryColor: 'gold',
primaryColor: 'black',
secondaryColor: 'gray',
tertiaryColor: 'orange',
colors: {
black: pureBlack,
gray: {
hex: '#75787B',
rgb: [117, 120, 123],
hex: '#A5ACAF',
rgb: [165, 172, 175],
},
orange: {
hex: '#FC4C02',
rgb: [252, 76, 2],
},
gold: {
hex: '#CAB64B',
rgb: [202, 182, 75],
},
},
},
SHD: {
Expand Down Expand Up @@ -318,19 +314,19 @@ const colors = {
},
VAL: {
fullName: 'Los Angeles Valiant',
primaryColor: 'darkGreen',
secondaryColor: 'black',
tertiaryColor: 'yellow',
primaryColor: 'blue',
secondaryColor: 'yellow',
tertiaryColor: 'white',
colors: {
darkGreen: {
hex: '#004438',
rgb: [0, 68, 56],
blue: {
hex: '#1888C6',
rgb: [24, 136, 198],
},
black: pureBlack,
yellow: {
hex: '#D9C756',
rgb: [217, 199, 86],
hex: '#FFD100',
rgb: [255, 209, 0],
},
white: pureWhite,
},
},
VAN: {
Expand Down
17 changes: 11 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import {
compose, keys, prop, propOr, path, ifElse,
isEmpty, identity, toUpper, __,
compose,
keys,
prop,
propOr,
path,
ifElse,
isEmpty,
identity,
toUpper,
__,
} from 'ramda';

import OwlColors from './colors';
Expand Down Expand Up @@ -93,10 +101,7 @@ export const getTeamName = compose(
* @returns {string[]} an array of Overwatch League team colors.
*/
export const getColorList = compose(
compose(
checkEmpty,
getColorKeys,
),
compose(checkEmpty, getColorKeys),
propOr({}, __, OwlColors),
toUpper,
);