Consider a set of colors in the LAB color space.

lab = {LABColor[0.2, 0.5, 0.8], LABColor[0.6, -0.5, 0.2], 
  LABColor[0.9, 0.5, -0.8]};

And the corresponding opacities are


How can I combine the colors and their corresponding opacities so that I get

laba={LABColor[0.2, 0.5, 0.8,0.2], LABColor[0.6, -0.5, 0.2,0.6], 
  LABColor[0.9, 0.5, -0.8,0.4]}
  • 2
    $\begingroup$ Look up MapThread. MapThread[Append, {lab, a}] $\endgroup$ – Szabolcs Jan 16 '18 at 16:36


MapThread[Append, {lab, a}]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.