Coder Social home page Coder Social logo

colors's People

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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

colors's Issues

Tag and submit to bower

This is a nice little utility. Would you consider tagging the versions and putting it on bower so it's easier to get? Just tag with semver (e.g. git tag v1.2.3) and add a bower.json file structured:

{
  "name": "my-project",
  "version": "1.0.0",
  "main": "path/to/main.css",
  "ignore": [
    ".jshintrc",
    "**/*.txt"
  ],
  "dependencies": {
    "<name>": "<version>",
    "<name>": "<folder>",
    "<name>": "<package>"
  },
  "devDependencies": {
    "<test-framework-name>": "<version>"
  }
}

Then submit: bower register <my-package-name> <git-endpoint>

If you want I can submit a PR.

Errors in hsv2hsl

The hsv2hsl method is not returning valid HSL color values.

I believe something went wrong at some point with some variable names.

complement returns wrong data

I tried calling this:
Colors.complement('#ffffff')

which returned:
"##000000#000000#000000"

also this:
Colors.complement('#adf004')

returned:
"##525252#fff#fbfbfb" so I cant just split it by '#' because I wouldn't know which value to use.

Abstract methods into separate modules

To make the code base more maintainable, I'm going to break each method out into their own modules and apply a more functional style of programming to each one.

More info to come soon.

rgb2hex sometimes gives invalid hex values

The rgb2hex() function sometimes gives too short hex values, consisting of only 5 characters after the '#'.

Some RGB values that return invalid hex values are:
R: 54, G: 15, B: 69 (gives #36f45)
R: 10, G: 250, B: 58 (gives #afa3a)
R: 28, G: 10, B: 53 (gives #1ca35)

Version 2.0

Update to version 2.0 with major changes to the API and testing.

complement of canonical hex input produces erroneous result

Hi Matthew,

I tried using colors.js (and the minimized version) to generate complementary colors for a given hex value, but the output is returning much too large a value (see notes below). Honestly, I'm not exactly sure why it works in your demo page. Otherwise a very nice tool. thanks!

value in >> value out for Colors.complement('#FFFFFF') (or using '#ffffff')

FFFFFF >> ##000000#000000#000000

to fix the issue, I modified the associated code in the (raw colors.js) complement method as follows:
rtn += (this.rgb2hex(255 - this.hex2rgb(c.substr(0, 2)))).substr(1, 2);
rtn += (this.rgb2hex(255 - this.hex2rgb(c.substr(2, 2)))).substr(1, 2);
rtn += (this.rgb2hex(255 - this.hex2rgb(c.substr(4, 2)))).substr(1, 2);

There's probably a more elegant solution, but this works for me, anyway.

Most likely (I haven't tested) the issue affects the abbreviated form #XYZ as well.

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.