diff --git a/src/app/pages/ColorGame/components/Instructions/Instructions.module.scss b/src/app/pages/ColorGame/components/Instructions/Instructions.module.scss index 12921d2e..0f9e0671 100644 --- a/src/app/pages/ColorGame/components/Instructions/Instructions.module.scss +++ b/src/app/pages/ColorGame/components/Instructions/Instructions.module.scss @@ -2,7 +2,6 @@ padding: 20px; border: 2px solid var(--silver); border-radius: 18px; - // width: min-content; .header { display: grid; @@ -14,7 +13,7 @@ margin: 20px 0; line-height: 1.3em; width: fit-content; - font-size: 1.3em; + font-size: 1.1em; @media screen and (max-width: 1000px) { font-size: 1em; diff --git a/src/app/pages/ColorGame/components/Results/Results.jsx b/src/app/pages/ColorGame/components/Results/Results.jsx index 67e6a8c9..bd764339 100644 --- a/src/app/pages/ColorGame/components/Results/Results.jsx +++ b/src/app/pages/ColorGame/components/Results/Results.jsx @@ -2,6 +2,32 @@ import { Text } from "app/components"; import { memo } from "react"; import cn from "./Results.module.scss"; +const PIXEL_RANGE = 255; + +const TIPS = [ + "To get a lighter color, increase the value of all three colors", + "To get a darker color, decrease the value of all three colors", + "Red and blue make pink", + "A bit of red and more of blue make purple", + "Red and green make yellow", + "A lot of red and bit of green make brown", + "Black is the absence of all three colors", + "Gray is just a shade of black and white", + "To get a pastel color, make sure all three colors values are high", + "To get a neon color, make sure your accent color/s is high but low in the others", + "RGB color mixing works opposite of traditional print", +]; + +const convertPixelValueDiffToReadablePercent = (pixelValue) => + (Math.abs(pixelValue / PIXEL_RANGE) * 100).toFixed(2) + "%"; + +const getColorOffsetLabel = (pixelValue, color) => { + if (pixelValue === 0) return ""; + return `${convertPixelValueDiffToReadablePercent(pixelValue)} ${ + pixelValue < 0 ? "less" : "more" + } ${color}`; +}; + export const Results = memo(function Results({ report }) { const actualColor = "#" + report.actual; const guessColor = "#" + report.guess; @@ -40,6 +66,30 @@ export const Results = memo(function Results({ report }) { +