The color of my triangle doesn't change

i’m trying to put the brown color in a triangle, however, it doesn’t work and with other people and the same command works, i’m using the latest version… help me

%exemple-color-brown

colorx  = [128, 64, 0]/255;

x = [0 5 10];
y = [10 19 10];
fill(x,y,colorx);
hold on

It would work if you add one more (dummy) vortex so that the size of x and y is not 3:

x = [0 5 5 10];
y = [10 19 19 10];
fill(x,y,colorx);

Not sure if this is a bug or a “feature”; documentation is kind of ambiguous.

Could you file a bug report about this at bugs.octave.org?

This is a Matlab compatibility issue. When the color specifier is of the same size as the number of vertices then each point in the color matrix becomes the indexed colormap value of the color of the specified vertex, and the color as a whole is interpolated. But, this should not happen if the color specifier is a single RGB color. Unfortunately, what Octave seems to be doing is assuming that because there are three vertices and also three color values in the color specification that interpolated colors are desired.

I have a patch for this and will update the bug report when it is filed.

Bug report is at GNU Octave - Bugs: bug #61127, fill() color spec color spec is... [Savannah]

I checked in a fix here: octave: a150f1945ad0