4
$\begingroup$

This question from a course has proven too hard for me

Blend a list of colors with hues from 0 to 1 in increments of 0.1.

I tried this

Blend[Table[{Hue[n]},{n,0,1,0.1}]]

but the output is considered erroneous.

Maybe you have some deeper insight into my failed attempt. Thank you very much.

$\endgroup$
1
  • $\begingroup$ Another way is just Hue[0.5] $\endgroup$
    – yarchik
    Commented Jun 22 at 20:56

2 Answers 2

6
$\begingroup$

You added an extra layer of curly braces.

Blend[Table[Hue[n], {n, 0, 1, 0.1}]]

enter image description here

$\endgroup$
5
$\begingroup$

The issue with your code is that the Table function creates a nested list structure, and Blend expects a flat list of colors. Additionally, Hue should not be enclosed in a list. Here's how you can correct your code:

Blend[Table[Hue[n], {n, 0, 1, 0.1}]]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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