Skip to content

banyudu/to-oklch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

to-oklch

This is a simple tool to convert color to oklch.

Usage

Use as a module

import { transform } from 'to-oklch'
const oklch = transform('rgb(255, 0, 0)')

Use as a command

cat styles.css | npx to-oklch > styles-oklch.css

Example

Input File

/* styles.css */
body {
  background-color: #f00;
  color: rgb(0, 0, 255);
  border-color: #fafafa;
}

Output File

/* styles-oklch.css */
body {
  background-color: oklch(0.628 0.258 29.234) /* rgba: rgb(255, 0, 0), hex: #f00 */;
  color: oklch(0.452 0.313 264.052) /* rgba: rgb(0, 0, 255), hex: #00f */;
  border-color: oklch(0.985 0 0) /* rgba: rgb(250, 250, 250), hex: #fafafa */;
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published