Giter Club home page Giter Club logo

Comments (3)

cormullion avatar cormullion commented on June 8, 2024 1

OK! By coincidence I was just editing it to something similar.

from colorschemes.jl.

cormullion avatar cormullion commented on June 8, 2024

Cool idea. How about if I added an extra method:

julia-1.2> using ColorSchemes, Colors, ColorTypes, FixedPointNumbers

julia-1.2> function get(cs::ColorScheme, g::Color{T,1} where T<:Union{Bool, AbstractFloat, FixedPoint})
    get(cs, ColorTypes.gray(g))
end

julia-1.2> get(ColorSchemes.magma, N0f16(1.0))
RGB{Float64}(0.987053,0.991438,0.749504)

julia-1.2> get(ColorSchemes.magma, Gray(N0f16(1.0)))
RGB{Float64}(0.987053,0.991438,0.749504)

from colorschemes.jl.

tlnagy avatar tlnagy commented on June 8, 2024

Yeah! That looks good. I think it would probably be better to use get(cs, gray(g)) since I think that's the recommended way to unwrap Gray values.

from colorschemes.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.