Code Monkey home page Code Monkey logo

convert-to-oklch's Introduction

My projects ๐Ÿ‘จโ€๐Ÿ’ป

  • convert-to-oklch, CLI tool to convert colors into new oklch color format.
  • stylelint-gamut, stylelint plugin that helps to work with different color spaces.

Open source contributions ๐ŸŒฟ

I'm a contributor of stylelint, postcss and many others.

Favourite books on programming, frontend, design etc.

Contacts โœ‰๏ธ

convert-to-oklch's People

Contributors

ai avatar fpetrakov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

zaooa belzecue

convert-to-oklch's Issues

Lightness not converted to a percentage

While attempting to convert css files containing hex, hsl, and rgb color spaces to oklch, I found in each instance only the C and H components were successfully converted.

L (lightness) failed to convert to a percentile value. The command used was:

npx convert-to-oklch ./colours/*.css -p 2

Convert-to-oklch version:- 1.2.7

Below is a small sampling (Before/After). As you will see, Lightness converted only to a decimal value, such as used in the lch colorspace; visually, the colours seem consistent.

Conversion to a percentage value, required for the oklch colorspace has not been performed:

HEX Colorspace:

# Before conversion
.hex_amethyst { color: color: #9966cc; }
.hex_android-green { color: #a4c639; }
.hex_antique-brass { color: #cd9575; }
.hex_antique-fuchsia { color: #915c83; }
.hex_apple-green { color: #8db600; }
.hex_apricot { color: #fbceb1; }

# After conversion
.hex_amethyst { color: oklch(0.6 0.2 310); }
.hex_android-green { color: oklch(0.8 0.2 120); }
.hex_antique-brass { color: oklch(0.7 0.1 51); }
.hex_antique-fuchsia { color: oklch(0.5 0.1 340); }
.hex_apple-green { color: oklch(0.7 0.2 120); }
.hex_apricot { color: oklch(0.9 0.1 54); }

HSL Colorspace:

# Before conversion
.hsl_amethyst { color: hsl(270, 50%, 60%); }
.hsl_android-green { color: hsl(74.5, 55.3%, 50%); }
.hsl_antique-brass { color: hsl(21.8, 46.8%, 63.1%); }
.hsl_antique-fuchsia { color: hsl(315.8, 22.4%, 46.5%); }
.hsl_apple-green { color: hsl(73.5, 100%, 35.7%); }
.hsl_apricot { color: hsl(23.5, 90.2%, 83.9%); }

# After conversion
.hsl_amethyst { color: oklch(0.6 0.2 310); }
.hsl_android-green { color: oklch(0.8 0.2 120); }
.hsl_antique-brass { color: oklch(0.7 0.1 51); }
.hsl_antique-fuchsia { color: oklch(0.5 0.1 340); }
.hsl_apple-green { color: oklch(0.7 0.2 120); }
.hsl_apricot { color: oklch(0.9 0.1 54); }

RGB Colorspace:

# Before conversion
.rgb_amethyst { color: rgb(153, 102, 204); }
.rgb_android-green { color: rgb(164, 198, 57); }
.rgb_antique-brass { color: rgb(205, 149, 117); }
.rgb_antique-fuchsia { color: rgb(145, 92, 131); }
.rgb_apple-green { color: rgb(141, 182, 0); }
.rgb_apricot { color: rgb(251, 206, 177); }

# After conversion
.rgb_amethyst { color: oklch(0.6 0.2 310); }
.rgb_android-green { color: oklch(0.8 0.2 120); }
.rgb_antique-brass { color: oklch(0.7 0.1 51); }
.rgb_antique-fuchsia { color: oklch(0.5 0.1 340); }
.rgb_apple-green { color: oklch(0.7 0.2 120); }
.rgb_apricot { color: oklch(0.9 0.1 54); }

I hope this brief description is sufficient to correct the issue. Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.