Skip to content

Add precision option to oklch output#2

Open
jpc-ae wants to merge 1 commit into
yorukot:mainfrom
jpc-ae:patch-1
Open

Add precision option to oklch output#2
jpc-ae wants to merge 1 commit into
yorukot:mainfrom
jpc-ae:patch-1

Conversation

@jpc-ae

@jpc-ae jpc-ae commented Nov 14, 2025

Copy link
Copy Markdown

Cleaned up return logic and added precision to formatOKLCH function (will add toggle is separate change)

Cleaned up return logic and added precision to formatOKLCH function (will add toggle is separate change)
@vercel

vercel Bot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

@jpc-ae is attempting to deploy a commit to the yorukot's project Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Nov 16, 2025

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
color-src Error Error Nov 16, 2025 2:23am

@yorukot

yorukot commented Nov 16, 2025

Copy link
Copy Markdown
Owner

Hey, first of all, thank you for your contribution.
But I think there is an error. Could you fix it? Thanks.

Failed to compile.
./lib/colorConversion.ts:211:156
Type error: 'oklch.alpha' is possibly 'undefined'.
  209 |   const includeAlpha = oklch.alpha !== undefined && 1 > oklch.alpha && oklch.alpha > 0.001;
  210 |
> 211 |   const values = `${oklch.l.toFixed(lPrecision)}${separator}${oklch.c.toFixed(cPrecision)}${separator}${oklch.h.toFixed(hPrecision)}${includeAlpha ? ` / ${oklch.alpha.toFixed(aPrecision)}` : ''}`
      |                                                                                                                                                            ^
  212 |   
  213 |   return simplified ? values : `oklch(${values})`;
  214 | }
Next.js build worker exited with code: 1 and signal: null
 ELIFECYCLE  Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants