{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/Color.jl/issues/101","labels_url":"https://api.github.com/repos/JuliaLang/Color.jl/issues/101/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/Color.jl/issues/101/comments","events_url":"https://api.github.com/repos/JuliaLang/Color.jl/issues/101/events","html_url":"https://github.com/JuliaLang/Color.jl/issues/101","id":99920615,"number":101,"title":"Fixing Coloramity","user":{"login":"timholy","id":1525481,"avatar_url":"https://avatars.githubusercontent.com/u/1525481?v=3","gravatar_id":"","url":"https://api.github.com/users/timholy","html_url":"https://github.com/timholy","followers_url":"https://api.github.com/users/timholy/followers","following_url":"https://api.github.com/users/timholy/following{/other_user}","gists_url":"https://api.github.com/users/timholy/gists{/gist_id}","starred_url":"https://api.github.com/users/timholy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timholy/subscriptions","organizations_url":"https://api.github.com/users/timholy/orgs","repos_url":"https://api.github.com/users/timholy/repos","events_url":"https://api.github.com/users/timholy/events{/privacy}","received_events_url":"https://api.github.com/users/timholy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":67,"created_at":"2015-08-09T19:09:48Z","updated_at":"2015-08-24T10:28:37Z","closed_at":null,"body":"In an ideal world, one would be able to:\r\n- load an image from a disk file\r\n- visualize it using using OpenGL\r\n- perform some calculations on it using Image's algorithms\r\n- plot the results in Gadfly\r\n\r\nUnfortunately, currently we are far from living in this world. It seems that he biggest problem is the separation between this package (Color) and [ColorTypes.jl](https://github.com/SimonDanisch/ColorTypes.jl). I'm running into this in the course of trying to split out functionality in Images into the [JuliaIO](https://github.com/JuliaIO) packages. Overall I agree that splitting this functionality is a good thing: for example, it would be great to largely divorce `Images.jl` from ImageMagick. The problem is that the [`ImageMagick.jl` package](https://github.com/JuliaIO/ImageMagick.jl) started by Simon (using code lifted from Images) uses `ColorTypes`, while `Images` (and essentially all other packages) uses `Color`, so the GL&JuliaIO world is completely incompatible with the rest of the package ecosystem.\r\n\r\n```\r\n@rant begin\r\n    I'd like to propose that henceforth if one snips out a chunk of functionality\r\n    (especially, types) from one popular package into a standalone package, it's\r\n    incumbent on the programmer to issue pull requests rebasing the\r\n    \"parent\" package on the new standalone package. This includes getting\r\n    all the parent's tests working. If you're not willing to do that, it's better to use\r\n    the parent package unmodified.\r\nend\r\n```\r\n\r\nI have a proposal for fixing this, and I'm (grumpily) willing to put in the (considerable) time needed to make it happen:\r\n- @simondanisch presumably needs to base color types on `FixedSizeArrays.jl` for smooth interoperability with GL. Consequently, I propose we keep his design of having a standalone ColorTypes package that only encodes the basic color type definitions, and that it be based on FixedSizeArrays. \r\n- We make some changes (see below) to the design of ColorTypes to make it a little more like `Color.jl`. We also pick names that are less awkward than our current names.\r\n- We rebase Color on top of ColorTypes, naming the new package `Colors.jl`. We issue a deprecation warning for `using Color`.\r\n- To ensure that people actually use the new package, I submit the necessary pull requests against Cairo, ColorBrewer, Escher, Gadfly, Gtk, Images, ImageView, ProfileView, PyPlot, Tk, and Winston. There are a few other packages that use Color, but I can't fix everything, and these are the main ones I've heard of. It's up to @simondanisch to update the GL packages.\r\n\r\nCC @lobingera, @timothyrenner, @shashi, @dcjones, @vtjnash, @stevengj, @nolta, @simondanisch, @jiahao. I'd like feedback from most/all of you before undertaking this course, since it will be a fair amount of work and I'd like to have some confidence that the PR I submit will be accepted.\r\n\r\nProposed type hierarchy sketch for the new ColorTypes:\r\n```jl\r\nusing FixedSizeArrays\r\n\r\n# Paint means either Color or Color+Transparency\r\nabstract AbstractPaint{T, N} <: FixedVector{T, N}\r\n\r\n# AbstractColor means just color, no transparency\r\nabstract AbstractColor{T, N} <: AbstractPaint{T, N}\r\nabstract Color{T} <: AbstractColor{T, 3}\r\nabstract AbstractRGB{T} <: Color{T}\r\n\r\n# Types with transparency\r\nabstract Transparent{T,N} <: AbstractPaint{T,N}\r\n# Because storage order matters for some applications, we have both\r\n# \"AlphaColor\" and \"ColorAlpha\"\r\nabstract AbstractAlphaColor{T,N} <: Transparent{T,N} # storage order alpha-color\r\nabstract AbstractColorAlpha{T,N} <: Transparent{T,N} # storage order color-alpha\r\n\r\n# Concrete types\r\nimmutable RGB{T} <: Color{T}\r\n    r::T\r\n    g::T\r\n    b::T\r\nend\r\n\r\n# ...and so forth\r\n\r\nimmutable AlphaColor{C<:Color,T} <: AbstractAlphaColor{T,4}\r\n    alpha::T\r\n    c::C   # C really has to be Color{T} (use inner constructor here)\r\nend\r\n\r\nimmutable ColorAlpha{C<:Color,T} <: AbstractAlphaColor{T,4}\r\n    c::C\r\n    alpha::T\r\nend\r\n\r\n# Grayscale\r\nimmutable Gray{T} <: AbstractColor{T,1}\r\n    val::T\r\nend\r\n\r\nimmutable AlphaGray{G,T} <: Transparent{T,2}\r\n    alpha::T\r\n    c::G\r\nend\r\n\r\nimmutable GrayAlpha{G,T} <: Transparent{T,2}\r\n    c::G\r\n    alpha::T\r\nend\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaLang/Color.jl/issues/comments/134137795","html_url":"https://github.com/JuliaLang/Color.jl/issues/101#issuecomment-134137795","issue_url":"https://api.github.com/repos/JuliaLang/Color.jl/issues/101","id":134137795,"user":{"login":"timholy","id":1525481,"avatar_url":"https://avatars.githubusercontent.com/u/1525481?v=3","gravatar_id":"","url":"https://api.github.com/users/timholy","html_url":"https://github.com/timholy","followers_url":"https://api.github.com/users/timholy/followers","following_url":"https://api.github.com/users/timholy/following{/other_user}","gists_url":"https://api.github.com/users/timholy/gists{/gist_id}","starred_url":"https://api.github.com/users/timholy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timholy/subscriptions","organizations_url":"https://api.github.com/users/timholy/orgs","repos_url":"https://api.github.com/users/timholy/repos","events_url":"https://api.github.com/users/timholy/events{/privacy}","received_events_url":"https://api.github.com/users/timholy/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T10:28:37Z","updated_at":"2015-08-24T10:28:37Z","body":"Thanks for commenting, @AndrewGibb. If you want to add `Rec709`, the best approach would probably be to add the corresponding number type to `FixedPointNumbers`.\r\n\r\nThe idea of adding an extension guide is a good one."}}