Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/conversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ cnvt(::Type{CV}, c::Union{DIN99d, DIN99o, DIN99}) where {CV<:AbstractRGB} = cnvt
error("No conversion of ", c, " to ", CV, " has been defined")
end

function cnvt(::Type{CV}, c::CMY) where CV<:AbstractRGB
_one = one(c.c)
CV(_one - c.c, _one - c.m, _one - c.y)
end

# AbstractGray --> AbstractRGB conversions are implemented in ColorTypes.jl


Expand Down Expand Up @@ -811,6 +816,10 @@ end

cnvt(::Type{YCbCr{T}}, c::Color) where {T} = cnvt(YCbCr{T}, convert(RGB{T}, c)::RGB{T})

function cnvt(::Type{CMY{T}}, c::AbstractRGB) where T
_one = one(c.r)
CMY(_one - c.r, _one - c.g, _one - c.b)
end

# To Gray
# -------
Expand Down
Loading