The code below is to create something like a logo. I want to apply a color gradient over the polygons of the pattern, but they vary along the path. The image that I want to approach is this:
ang = 66 Degree; h = 70; esp = 20.5;
p1 = {0, 0};
p2 = {h/Tan[ang], h};
p3 = {p2[[1]] + esp/Sin[ang], h};
p4 = {p1[[1]] + esp/Sin[ang], 0};
shift = {p3[[1]] - esp, 0};
rectangle = Polygon[{{0, 0}, {esp, 0}, {esp, h}, {0, h}}];
parallelogram = Polygon[{p1, p2, p3, p4}];
parallelogram2 = GeometricTransformation[
parallelogram,
{
{{1, 0}, {0, -1}},
{0, h} + {p2[[1]], 0} + 4 shift
}
];
Graphics[
{
EdgeForm[{Thick, Black}], FaceForm[Gray],
Table[Translate[rectangle, i shift], {i, 1, 4}],
parallelogram2,
EdgeForm[{Thick, Black}], FaceForm[White],
Table[Translate[parallelogram, i shift], {i, 0, 4}]
}
]
I believe the Blend function is the best option, but I do not understand how to apply it ...
EDIT
I liked KennyColnago's solution, but I'm still looking for something closer to the image.
In an attempt to approach the solution I tried at least to define the four colors of each corner of the polygons. Below the pixels of the first polygon ...
g1 = {{3, 2}, {50, 2}, {74, 155}, {117, 155}};
That way I got all 20 pixels. Four pixels for each of the five front polygons ...
corners = 4;
g1 = {{3, 2}, {50, 2}, {74, 155}, {117, 155}};
img = Import[
"C:\\Users\\Leandro\\Desktop\\Image.png"];
Map[RGBColor,
Map[PixelValue[img, #] &,
NestList[Plus[# + Table[{71, 0}, corners]] &, g1,
corners], {2}], {2}]





