Skip to content

Specifying the color space for manipulation #48

@kimikage

Description

@kimikage

(Perhaps, as @johnnychen94 knows,) I am currently rethinking the definition of default color spaces for YIQ and YCbCr in ColorTypes.jl and Colors.jl. (cf. JuliaGraphics/Colors.jl#453, JuliaGraphics/ColorTypes.jl#250)

AFAIK, this is the only package that explicitly uses YIQ. This package is indifferent about the gamma of YIQ color space, even though it is designed to manipulate the contrast. 😅

If the implementation of the conversion from RGB etc. to YIQ is slightly changed, will there be any inconvenience?

In any case, for compatibility and convenience reasons, I think it might be a good idea to allow the user to explicitly specify the color space in which to manipulate the contrast.
So, what about adding the following getter and setter to the keyword arguments of the API?

getluma(c::Colorant)
setluma(c::Colorant, luma::Real)

Also, what about switching the default implementation of the getters and setters depending on the color type?
For example:

color types luma-like value
(fallback) YIQ(c).y
Gray gray(c)
HSV c.v
HSL c.l
HSI c.i
Lab/Luv c.l / 100
XYZ/xyY xyY(c).Y

Of course, the feature should be realized with outside of this package by using MappedArray or something. My main aim is to reduce the impact of breaking changes in ColorTypes.jl and Colors.jl.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions