gdirk07 / PokemonChecker

Playing around with APIs
https://gdirk07.github.io/PokemonChecker/
0 stars 0 forks source link

Modify stats colour to represent the value #40

Closed gdirk07 closed 2 years ago

gdirk07 commented 2 years ago

Right now the stats are coloured white, I feel it would be pleasing to colour code stats depending on how low or high it is. We can start with a simple Red for stats <50, Yellow for stats >=50 and <100, and green for >= 100. Now that we have our style component in we can take a look at this. The priority will be low, but an interesting task for anyone to dive in and learn MUI

jeremy-jtlo commented 2 years ago

This should be easier to accomplish now that the styles are in the JS components themselves.

Maybe the stat displays should have a helper function that returns a colour value based on an input? Something like

get statDisplayColour(stat: number): string

Takes a number, outputs a hex string for red/yellow/green. This way all the colour calculations go through 1 function, and we can make it as granular as necessary.