You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With great interest I am exploring your fine package farver but I have issues while using farver::encode_colour
My objective is to calculate color codes between color spaces. Here I get a range of colours in CIELAB space using:
That works just fine and next I create a figure with the result data, like:
With the above I want to show (graded) colors along the CIELAB a-axis with the b-axis value of each color set to 0 (neutral point) at the lightness level set to 50.
But, now I want to do the same for the CIELAB b-axis using this command:
So, maybe I am confused about how to set values for the a and b axis (dimension) in CIELAB but so far I found only one example in the documention that produces the expected result (which I used succesfully for the first example above).
Time permitting, I really apreciate your helping hand how to properly set such parameters for CIELAB (and OKLAB).
Best,
Eric
The text was updated successfully, but these errors were encountered:
That works just fine and next I create a figure with the result data, like:
So, my little tricky error was that I did not use a second closing bracket that is required )), from="lab")
For those interested in calculating the CIELAB AB plane at a given L-value, this is code how to produce that:
# Create a plane of colors for the CIELAB color space using the farver package
# Define the range and step size for a and b
a_range <- seq(-100, 100, by = 10)
b_range <- seq(-100, 100, by = 10)
# Create a grid of a and b values
lab_grid <- expand.grid(a = a_range, b = b_range)
# Define the constant lightness (L) value
lab_L <- 50
# Create the colors using the farver package
lab_AxB_L50_10 <- farver::encode_colour(
cbind(
l = lab_L,
a = lab_grid$a,
b = lab_grid$b
), from = "lab"
)
Dear Thomas,
With great interest I am exploring your fine package
farver
but I have issues while usingfarver::encode_colour
My objective is to calculate color codes between color spaces. Here I get a range of colours in CIELAB space using:
That works just fine and next I create a figure with the result data, like:
With the above I want to show (graded) colors along the CIELAB a-axis with the b-axis value of each color set to 0 (neutral point) at the lightness level set to 50.
But, now I want to do the same for the CIELAB b-axis using this command:
As such the command code runs without any complaint, but using
lab_b_L50
after that results in the error message:I also tried:
which produces the same error message.
Note that this command code (for the a-axis):
also produces the same error message.
So, maybe I am confused about how to set values for the a and b axis (dimension) in CIELAB but so far I found only one example in the documention that produces the expected result (which I used succesfully for the first example above).
Time permitting, I really apreciate your helping hand how to properly set such parameters for CIELAB (and OKLAB).
Best,
Eric
The text was updated successfully, but these errors were encountered: