[R] package colorspace and .WhitePoint question
Ach|m@Ze||e|@ @end|ng |rom u|bk@@c@@t
Fri Jun 22 02:07:46 CEST 2018
As a follow-up to this issue:
A revised version of the "colorspace" package is now available on R-Forge
This provides a function whitepoint() that can query and/or modify the
whitepoint used in all color conversions within the package. To try it you
example("whitepoint", package = "colorspace")
Glenn, it would be great if you could try this and let us know if any
On Mon, 4 Jun 2018, Achim Zeileis wrote:
> currently, this is currently not exposed in "colorspace" AFAICS. You can
> modify it by changing .WhitePoint inside colorspace's NAMESPACE, though:
> R> assignInNamespace(".WhitePoint", rbind(c(95, 100, 105)),
> + ns = "colorspace")
> R> as(XYZ(100, 100, 100), "LAB")
> L A B
> [1,] 100 8.622384 3.226371
> I'll have another look whether this could be exposed easily (cc also Paul).
> On Mon, 4 Jun 2018, Glenn Davis wrote:
>> In colorspace.R I see:
>> setAs("color", "LAB", function(from)
>> LAB(.Call("as_LAB", from using coords, class(from), .WhitePoint, PACKAGE = "
>> names = dimnames(from using coords)[]))
>> .WhitePoint = NULL
>> and then in colorspace.c and the function CheckWhite(),
>> I see that .WhitePoint = NULL is converted to D65.
>> I would like to pass a different .WhitePoint to
>> as( XYZ( 100,100,100) , "LAB" )
>> I have tried 3 methods:
>> as( XYZ( 100,100,100) , "LAB", .WhitePoint=XYZ(95,100,105) )
>> .WhitePoint = XYZ(95,100,105)
>> assign( ".WhitePoint", XYZ(95,100,105), env=as.environment('package:
>> colorspace') )
>> but all fail, for different reasons.
>> How can I transform XYZ to LAB using a whitepoint different than D65 ?
>> Glenn Davis
>> gdavis using gluonics.com
>> [[alternative HTML version deleted]]
>> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> PLEASE do read the posting guide
>> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help