Code Monkey home page Code Monkey logo

color-blend's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar dpoh-var avatar greenkeeper[bot] avatar loilo avatar zhangciwu 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  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

color-blend's Issues

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! šŸŽŠ

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If youā€™re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didnā€™t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didnā€™t touch job or matrix configurations because these tend to be quite specific and complex, and itā€™s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what youā€™re doing it may require additional work or may not be applicable at all. Weā€™re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, Iā€™m a humble robot and wonā€™t feel rejected šŸ¤–


FAQ and help

There is a collection of frequently asked questions. If those donā€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot šŸŒ“

Cannot find module "./types"

With TypeScript 3.1.3, importing any of the exported color-blend members, e.g.:

import {colorBurn} from "color-blend";

results in error:

Cannot find module './types'.

Multiply with white returns the non-white value

If white with an alpha value is passed to multiply the non-white value is returned:

Multiply w\ white:

 {
  backdrop: { r: 255, g: 255, b: 255, a: 0.12 }, // White
  source: { r: 0, g: 107, b: 84, a: 1 }, // Non-White
  ret: { r: 0, g: 107, b: 84, a: 1 } // SAME Non-White Value
}

It works with a non-white source or backdrop value:

Multiply w\ non-white:

{
  backdrop: { r: 0, g: 107, b: 84, a: 0.12 },
  source: { r: 251, g: 253, b: 250, a: 1 },
  ret: { r: 221, g: 235, b: 230, a: 1 }
}

Is this the expected behavior? I'm getting accurate results when multiplying non-white values.

const { multiply } = require("color-blend");

const colorWhiteAlpha12 = { r: 255, g: 255, b: 255, a: 0.12 };
const colorPrimary = { r: 0, g: 107, b: 84, a: 1 };

const colorSurface = { r: 251, g: 253, b: 250, a: 1 };
const colorPrimaryAlpha12 = { r: 0, g: 107, b: 84, a: 0.12 };

const colorPrimaryTint = multiply(colorWhiteAlpha12, colorPrimary);
const colorSurfaceTint = multiply(colorPrimaryAlpha12, colorSurface);

console.log("colorPrimaryTint: ", colorPrimaryTint);
console.log("colorSurfaceTint: ", colorSurfaceTint);

/* OUTPUT
colorPrimaryTint:  { r: 0, g: 107, b: 84, a: 1 } - Same as `colorPrimary`
colorSurfaceTint:  { r: 221, g: 235, b: 230, a: 1 }
*/

alpha channel is needed

I found this package in this comment: https://github.com/Qix-/color/issues/99#issuecomment-266601291

i thought that it would be directly compatible with color, but its not totally:

e.g. this leads to wrong results, because color-blends needs an alpha channel (property a):

import Color from 'color'
import blender from 'color-blend'


const color1 = Color("#B5E684")
const colorBlended = blender.normal(color1, Color("yellow")) // returns {r: NaN, g: NaN, b: NaN, a: NaN}

Is this useful for rgb correction in photos?

I'm new to color blending. If I have a pixel in the photo that represents true red, green and then blue, based on how much each of these is off can I use this library to correct the pixels in the rest of the image?

For example if red in the photo appears as 240,13,85 when it should be 255,0,0 I'd like to apply the correction to the rest of the pixels. Same for the green pixel and blue.

Renfactor input / output parameters

Hello! Thank you very much for time and efforts put into this library.
May i draw your attention to one nuance?

I'm trying to use your great library with polished npm-package, cause i work on design-system and i need to blend some colors, with blend-modes, but i need to put some extra time because of the following.

Issue
Function rgba from polished works as follows
rgba(255, 205, 100, 0.7) or rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 })

But you package's output is { r: number, g: number, b: number, a: number }. so in order to use polished i need to write 2 functions
1st - to convert any polished result to entry format of your library
2nd - convert your library output to format, that polished understands

My proposal
Please, make color-blend output format either / or
a) an object { red: number, green: number, blue: number, alpha: number }
b) array of RGBA values as numbers [, , , ,] which then can be passed with ...spread syntax out of the box

This can be achieved either / or

  1. With some optional parameters to functions, which will determine output format
  2. Writing alternatively-named functions, similar to like you did in color-blend/unit

P.S.
With all the respect, it is just a proposal.
I dont have any problems writing such functions on my own in my project.
I just think this could help other people to use your library in more wide and flexible way, thats all.

Best wishes and kind regards,
Artemiy

Action required: Greenkeeper could not be activated šŸšØ

šŸšØ You need to enable Continuous Integration on all branches of this repository. šŸšØ

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didnā€™t receive a CI status on the greenkeeper/initial branch, itā€™s possible that you donā€™t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how itā€™s configured. Make sure it is set to run on all new branches. If you donā€™t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, youā€™ll need to re-trigger Greenkeeperā€™s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper Appā€™s white list on Github. You'll find this list on your repo or organizationā€™s settings page, under Installed GitHub Apps.

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.