Giter Site home page Giter Site logo

Comments (4)

c0bra avatar c0bra commented on July 16, 2024 1

@bsebastian86 thanks for that tip, and sorry for the delay.

I finally found a way to convert rgb to ryb so it looks like the demo page from from_hex method is working properly now.

from color-scheme-js.

bsebastian86 avatar bsebastian86 commented on July 16, 2024

Hi, seems this is a two year old issue that was unaddressed.

I noticed that this was giving the wrong results also, even on the demo page. Can you please tell me how to fix this? Thanks.

from color-scheme-js.

c0bra avatar c0bra commented on July 16, 2024

@bsebastian86 it looks like there's something being calculated incorrectly in rgb2hsv, however when I plug in different implementations, like this one: https://gist.github.com/mjackson/5311256, I still get an incorrect hue of 0 for the first color.

I checked Color::Scheme itself and it correctly returns 180 for the first color's hue. Its code for rgb2hsv hasn't changed in 11 years: https://github.com/rjbs/Color-Scheme/blob/master/lib/Color/Scheme.pm#L260

At this point I'm not sure where the issue lies... 😕

from color-scheme-js.

bsebastian86 avatar bsebastian86 commented on July 16, 2024

@c0bra i think it's because you are using the "h" value from HSV directly. The Hue here is based on the RGB color wheel, and not the RYB color wheel which the from_hue is based on.

This is actually my problem here. I need the formula to convert the Hue degree based on the RYB instead of the RGB. Can't find any resources on it, but Adobe's color and Paletton seem to have come up with it already... Programming is tough.

from color-scheme-js.

Related Issues (12)

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.