Coder Social home page Coder Social logo

Comments (11)

timholy avatar timholy commented on May 24, 2024

I'm not even sure what it would mean to have the alpha channel participate in any notion of distinguishability---if you draw a transparent red on top of itself several times, it becomes more red, and consequently isn't very distinguishable from full red.

So adding the alpha after running the opaque version of the algorithm seems to make sense, and at the moment I can't see any justification for those receiving different alpha values from one another. If they are different, which values do you assign to the newly-generated colorants?

from colors.jl.

tlnagy avatar tlnagy commented on May 24, 2024

If they are different, which values do you assign to the newly-generated colorants?

What is they in this context?

I'm starting to doubt that I would need to call distinguishable_colors here. Since this is full manual color mode, it might be better to simply trust the user to use distinguishable colors and not enforce it.

from colors.jl.

timholy avatar timholy commented on May 24, 2024

they = the different alpha values in the seed-vector that you pass into distinguishable_colors.

from colors.jl.

tlnagy avatar tlnagy commented on May 24, 2024

Ah, I see what you mean. Assign the alpha values to the new color most resembling the color they belong to in the seed-vector?

from colors.jl.

timholy avatar timholy commented on May 24, 2024

To me, that sounds like behavior that the user won't be able to predict without a careful read of the documentation. On balance I think I prefer the MethodError, as I just don't think it makes much sense to talk about distinguishability in the context of an alpha channel.

Can't you call map(color, seed) from Gadfly and then re-add whatever alpha channel makes you happy?

from colors.jl.

tlnagy avatar tlnagy commented on May 24, 2024

The MethodError is unfortunate though. Currently, when trying to use your own set of colors to Scale.color_discrete_manual, distinguishable_colors is always applied to the input. I guess one solution would be to not run the distinguishable_colors function if RGBA values are supplied.

from colors.jl.

timholy avatar timholy commented on May 24, 2024

I'd be fine with an informative error message.

from colors.jl.

tlnagy avatar tlnagy commented on May 24, 2024

Is that the best behavior though? You want to use some RGBA values in your plot and Gadfly errors out and tells you that you can't give alpha values? That seems a bit strict.

from colors.jl.

tlnagy avatar tlnagy commented on May 24, 2024

Note: I'm changing what I'm saying here from the OP. I don't think we should make any changes to Colors.jl, only that I shouldn't call distinguishable_colors when the user supplies RGBA values to the manual plot coloring function in Gadfly.

from colors.jl.

timholy avatar timholy commented on May 24, 2024

Right, I'm saying handle RGBA from the Gadfly side, since there's no obviously correct behavior in general. It would be fine to define a distinguishable_colors method here that gives an informative error message, though.

from colors.jl.

kimikage avatar kimikage commented on May 24, 2024

xref: PR #439

from colors.jl.

Related Issues (20)

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.