Code Monkey home page Code Monkey logo

acrylic's People

Contributors

prdx23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

acrylic's Issues

Complementary colors default to randomized fuzzy

The comment for Schemes.scheme says the default for fuzzy is 0:

fuzzy(int, optional):
adds a random value between -fuzzy and +fuzzy to
the generated hue. Can be set to `RANDOM` to use
the recommended value.
Default: 0

But it's coming in with a default value of -1:

def scheme(self, name, in_rgb=False, fuzzy=-1):

Causing it to randomize the complementary colors returned:

RANDOM = -1

scheme.complementary ryb colors very inaccurate (also resulting format broken)

Hi

I can not get accurate (or, well, "good enough") complementary colors of RYB colors. I tried looking into the code, but couldn't find where that is done.
It is accurate if I'd want the complementary of blue, yellow or red. But it feels like, in the conversion from rgb to ryb or back, there is no mapping done via trilinear interpolation or whatnot. (Interpolation between fixed conversion points on the ryb spectrum) I found that other programs do that. There is a C program I almost thought about porting to python, but I really have no idea what I'm doing.

What I do is:

  • Get tuple rgb color and make it acrylic
  • do a scheme complementary with "in_rgb=False" (and "fuzzy=0" because default is "-1" but there is another issue for that)
  • (find out that the resulting format now requires you to write: "color[0].rgb" instead of "color.rgb")
  • give back rgb code
    colorPx = (53, 53, 53)
    colorPx = acrylic.Color(rgb = (colorPx[0], colorPx[1], colorPx[2]))                        # colorPx = Color(rgb=(53, 53, 53))
    colorPx = colorPx.scheme(acrylic.Schemes.COMPLEMENTARY, in_rgb=False, fuzzy=0)             # colorPx = [Color(hsl=(0.0, 0.0, 20.78))] ... it's now a list with Color inside
    colorPx = acrylic.Color(ryb = (colorPx[0].ryb[0], colorPx[0].ryb[1], colorPx[0].ryb[2]))   # colorPx = Color(ryb=(202, 202, 202))
    colorPx = (colorPx.rgb[0], colorPx.rgb[1], colorPx.rgb[2])                                 # colorPx = (53, 53, 53) (bad example)

(I didn't want to create other variables just for this, so I used the same again and again)

I also tried converting to a ryb tuple after creating a acrylic.color (color.ryb[0], 1 ,2...), then creating another acrylic.color but this time it's "ryb = ...", do the scheme conversions, create another ryb tuple (this time with color[0].ryb[0] , 1 , 2..) Convert it to a rgb tuplr and look at that. But it's of course identical.

I can never get these complementary colors from the ryb example here: https://en.wikipedia.org/wiki/Complementary_colors

Besides that: I feel like the result when I convert to RGB or something else via colorPx = acrylic.Color(ryb = (colorPx[0], colorPx[1], colorPx[2])).rgb giving the result back in the format of Rgb(r=46, g=45, b=42) is very annoying, for me at least. I see the value in having a Rgb I can get r out of via color.Rgb.r, maybe. If that is even the correct way. Sorry, these fundamental things necessary to start programming are beyond me. :) (That's why I'm not doing that up there in the code)
But if I'm not inserting three variables I shouldn't get three variables out. Int in int out. Well... you know what I mean.

Greetings

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.