GithubHelp home page GithubHelp logo

fabiospampinato / khroma Goto Github PK

View Code? Open in Web Editor NEW
36.0 3.0 6.0 242 KB

A collection of functions for manipulating CSS colors, inspired by SASS.

License: MIT License

TypeScript 43.91% JavaScript 56.09%
sass manipulation color css hex rgb hsl

khroma's Issues

Hex alpha support

Most browsers support hex colors with an alpha channel in the format #RGBA. Should our library support this?

License reported as unknown

The license is not specified in the package.json file, therefore the package is listed as UNLICENSED (License=none) on the npm registry.

This makes the legal situation unclear and results in build failures due to unknown license constraints.

allow object oriented usage

๐Ÿ‘‹ hey there I'm working on a Sass like preprocessor and was hoping to use Khroma for color logic. The issue tho is that i really need to be able to create reusable Color objects to e.g. store as the values of a variable declaration. THe problem here is that Khroma reuses the same Channels instance for all work so it doesn't seem possible to store an intermediate representation of the color channels since any other color will mutate the same data. I see why this is the case, but any chance of getting a version of the API that allows creating reusable Color instances from strings?

License missing in package

The current package.json file does not include the license attribute. This is an issue for those systems which mirror or proxy access the download of external packages from npmjs.com.
Between version 2.0.0 and 2.1.0, the file LICENSE was renamed in license. This is fine, although not the most common practice, and it is not captured by some of those system which actively look for a LICENSE file and the license attribute in the package.json. The license shown on GitHub is not captured within the package, so it's not relevant when a package is downloaded.

Thus, the package.json should correctly include the license attribute and a new version of the package should be built.

Inconsistent percent->decimal conversion

https://github.com/fabiospampinato/sass.js/blob/778c040e6047d601e72140405aaf2480d32285fc/src/utils.ts#L28-L32

https://github.com/fabiospampinato/sass.js/blob/778c040e6047d601e72140405aaf2480d32285fc/src/utils.ts#L40-L44

I am confused on what the units should be for "percentage". Is 10% represented as 10 or 0.1? Based on the above function, one would assume that percentages are represented in their decimal format.

For instance:
per2dec(10) -> 2550 โŒ This makes no sense
per2dec(0.1) -> 26 ๐Ÿ‘

But this leads to some inconsistency with how per2dec and dec2per convert between each other.

Example:
per2dec(0.1) -> 26 dec2per(26) -> 10.2 what?

Logos

I've been playing around a bit in Figma trying to design a simple logo. Let me know if you like any of these (I am by no means a designer).

sasssilly
sasssans

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.