Giter Site home page Giter Site logo

lbragile / colormaster Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 4.0 1.41 MB

๐Ÿ† A powerful and fully typed module for all your coloring needs.

Home Page: https://www.npmjs.com/package/colormaster

License: MIT License

TypeScript 100.00%
color hacktoberfest package

colormaster's Introduction

Hey there!

My name is Lior Bragilevsky and I am a self taught Software Development Engineer that is always up to the challenge. I have firm goals to learn new things daily. My daily routine revolves around full stack projects that are of interest to me/for clients, play logical games like chess, workout, and hang out with friends.

GitHub Stats ๐Ÿ“ˆ

GitHub Stats Top Languages

TabMerger chessCAMO

How To Reach Me ๐Ÿ“ซ

StackOverflow Reddit GitHub LinkedIn Email

You can ask me anything you want, from collaborations on projects to help with a topic that you are currently stuck on - nothing is off limits.

colormaster's People

Contributors

dependabot[bot] avatar lbragile avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

colormaster's Issues

Add ability to convert to grayscale

For each color model, ColorMaster should have the ability to return the grayscale version.

Acceptance Criteria:

  • 1. For HSL โ†’ the saturation is set to 0 (desaturation = 1)
  • 2. Same as 1. but for RGB โ†’ convert to HSL, then back to RGB
  • 3. Same as 1. but for HEX โ†’ convert to HSL, then back to HEX

Add Inversion of color for RGB, HEX, HSL

For each color model, ColorMaster should have the ability to invert the current color.

Acceptance Criteria:

  • 1. For RGB, correctly returns the flipped values from 255 for each channel.
  • 2. Same as 1. but for HEX โ†’ converts to RGB first, then converts back to HSL
  • 3. Same as 1. but for HSL โ†’ converts to RGB first, then converts back to HSL

Notes

  • this is different from rotate(180). Here we simply look at the RGB values (in each case), subtract them from 255 and convert back to the correct model.

Add ability to Rotate color (hue value) for RGB, HEX, HSL

For each color model, ColorMaster should have the ability to set and/or adjust the hue via rotation of x degree.

Acceptance Criteria:

Setting To

  • 1. For HSL, pass in the desired value โ†’ the hue is set to the corresponding rotation value
  • 2. Same as 1. but for RGB โ†’ convert to HSL, then back to RGB
  • 3. Same as 1. but for HEX โ†’ convert to HSL, then back to HEX

Adjusting By

  • 1. For HSL, pass in the desired delta โ†’ the hue is adjusted by the corresponding rotation delta
  • 2. Same as 1. but for RGB โ†’ convert to HSL, then back to RGB
  • 3. Same as 1. but for HEX โ†’ convert to HSL, then back to HEX

  • Error checking is performed โ†’ clamp values as needed

Note

  • This is a helper function that might be useful for RGB & HEX values in addition to HSL

Add Extra Getter & Setter Functionality For RGB, HEX, HSL

For each color model, ColorMaster should have the ability to get and set the respective color in more ways than just an object.

Acceptance Criteria:

Have getter & setter functions for:

RGB

  • 1. String (properly formatted)
  • 2. Array of numbers
  • 3. (regression) Object โ† should have correct keys

HEX

  • 1. String (properly formatted)
  • 2. Array of strings
  • 3. (regression) Object โ† should have correct keys

HSL

  • 1. String (properly formatted)
  • 2. Array of numbers
  • 3. (regression) Object โ† should have correct keys

Note

In all cases, return the alpha channel as well

Add Saturation/Desaturation for RGB, HEX, HSL

For each color model, ColorMaster should have the ability to set and/or adjust the saturation.

Acceptance Criteria:

Setting To

  • 1. For HSL, pass in the desired value โ†’ the saturation is set to that value
  • 2. Same as 1. but for RGB โ†’ convert to HSL, then back to RGB
  • 3. Same as 1. but for HEX โ†’ convert to HSL, then back to HEX

Adjusting By

  • 1. For HSL, pass in the desired delta โ†’ the saturation is adjusted by that delta
  • 2. Same as 1. but for RGB โ†’ convert to HSL, then back to RGB
  • 3. Same as 1. but for HEX โ†’ convert to HSL, then back to HEX

  • Error checking is performed โ†’ clamp values as needed

Add ability to get different Color Schemes for RGB, HEX, HSL

For each color model, ColorMaster should have the ability to retrieve the corresponding harmony rule.

Rules

  1. Analogous
  2. Complementary
  3. Split Complementary
  4. Double Split Complementary
  5. Triad
  6. Square
  7. Rectangle
  8. Monochromatic

Acceptance Criteria:

In each case, an array of color values is returned with the corresponding model type.

Analogous

  • 1. For RGB
  • 2. Same as 1. but for HEX
  • 3. Same as 1. but for HSL

Complementary

  • 1. For RGB
  • 2. Same as 1. but for HEX
  • 3. Same as 1. but for HSL

Split Complementary

  • 1. For RGB
  • 2. Same as 1. but for HEX
  • 3. Same as 1. but for HSL

Double Split Complementary

  • 1. For RGB
  • 2. Same as 1. but for HEX
  • 3. Same as 1. but for HSL

Triad

  • 1. For RGB
  • 2. Same as 1. but for HEX
  • 3. Same as 1. but for HSL

Square

  • 1. For RGB
  • 2. Same as 1. but for HEX
  • 3. Same as 1. but for HSL

Rectangle

  • 1. For RGB
  • 2. Same as 1. but for HEX
  • 3. Same as 1. but for HSL

Monochromatic

  • 1. For RGB
  • 2. Same as 1. but for HEX
  • 3. Same as 1. but for HSL

Note that monochromatic has 3 options: tints, shades, and tones

Add ability to Lighten/Darken color for RGB, HEX, HSL

For each color model, ColorMaster should have the ability to set and/or adjust the lightness.

Acceptance Criteria:

Setting To

  • 1. For HSL, pass in the desired value โ†’ the lightness is set to that value
  • 2. Same as 1. but for RGB โ†’ convert to HSL, then back to RGB
  • 3. Same as 1. but for HEX โ†’ convert to HSL, then back to HEX

Adjusting By

  • 1. For HSL, pass in the desired delta โ†’ the lightness is adjusted by that delta
  • 2. Same as 1. but for RGB โ†’ convert to HSL, then back to RGB
  • 3. Same as 1. but for HEX โ†’ convert to HSL, then back to HEX

  • Error checking is performed โ†’ clamp values as needed

Add ability to manipulate Hue for RGB, HEX, HSL

For each color model, ColorMaster should have the ability to set and/or adjust the hue.

Acceptance Criteria:

Setting To

  • 1. For HSL, pass in the desired value โ†’ the hue is set to that value
  • 2. Same as 1. but for RGB โ†’ convert to HSL, then back to RGB
  • 3. Same as 1. but for HEX โ†’ convert to HSL, then back to HEX

Adjusting By

  • 1. For HSL, pass in the desired delta โ†’ the hue is adjusted by that delta
  • 2. Same as 1. but for RGB โ†’ convert to HSL, then back to RGB
  • 3. Same as 1. but for HEX โ†’ convert to HSL, then back to HEX

  • Error checking is performed โ†’ clamp values as needed

Note

  • This is a helper function that might be useful for RGB & HEX values in addition to HSL

Add Channel/Alpha manipulation for RGB, HEX, HSL

For each color model, ColorMaster should have the ability to set and/or adjust the value of channels (including alpha).

Acceptance Criteria:

Setting To

  • 1. For RGB, pass in the desired channel and value โ†’ the channel value is set to the passed in value
  • 2. Same as 1. but for HEX โ†’ Convert to RGB first, then back to HEX
  • 3. Same as 1. but for HSL โ†’ here the hue is relevant

Adjusting By

  • 1. For RGB, pass in the desired channel and delta change โ†’ the channel value is adjusted by the passed in delta
  • 2. Same as 1. but for HEX โ†’ Convert to RGB first, then back to HEX
  • 3. Same as 1. but for HSL โ†’ here the hue is relevant

  • Error checking is performed โ†’ clamp values as needed

Add ability to Mix multiple colors for RGB, HEX, HSL

For each color model, ColorMaster should have the ability to mix multiple colors with varying ratios.

Acceptance Criteria:

  • 1. For RGB, pass in the desired value & ratio โ†’ the new channel values are calculated based on these parameters
  • 2. Same as 1. but for HEX โ†’ convert to RGB, then back to HEX
  • 3. Same as 1. but for HSLโ†’ convert to RGB, then back to HSL

  • Error checking is performed โ†’ clamp values as needed

Note

Mixing is performed in LCHA space for optimal results.

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.