Source code used to draw examples of color interpolation for "arrow" documentation

% Draw examples of arrows with interpolated face colors.

% Arrow "A" - Interpolated color.  (Use 'FaceColor' and 'FaceVertexCData'.)
davinci( 'arrow', 'X',               [0 10], ...
                  'Y',               [0 0], ...
                  'Head.Length',     3, ...
                  'Head.Width',      5, ...
                  'Head.Sweep',      2, ...
                  'Shaft.Width',     0.9, ...
                  'FaceVertexCData', [ [1 1 0];        % Vertex #1.  Yellow.
                                       [1 0 0];        % Vertex #2.  Red.
                                       [1 .7 0];       % Vertex #3.  Off-yellow.
                                       [1 0 0];        % Vertex #4.  Red.
                                       [1 0 0];        % Vertex #5.  Red.
                                       [1 1 0];        % Vertex #6.  Yellow.
                                       [1 0 0] ], ...  % Vertex #7.  Red.
                  'FaceColor',       'interp' );    
hold on

% Arrow "B" - Interpolated color.  (Use 'FaceColor' and 'FaceVertexCData'.)
%           - Special case shape:  Looks like a battery.
davinci( 'arrow', 'X',               [15 25], ...
                  'Y',               [ 0  0], ...
                  'Head.Length',     1.5, ...
                  'Head.Width',      3, ...
                  'Head.Sweep',      0, ...
                  'Shaft.Width',     5, ...
                  'FaceVertexCData', [ [0 0 0];        % Vertex #1.  Black.
                                       [.5 0 0];       % Vertex #2.  Off-red.
                                       [.5 0 0];       % Vertex #3.  Off-red.
                                       [1 0 0];        % Vertex #4.  Red.
                                       [.5 0 0];       % Vertex #5.  Off-red.
                                       [.5 0 0];       % Vertex #6.  Off-red.
                                       [0 0 0] ], ...  % Vertex #7.  Black.
                   'FaceColor',      'interp' );

% Arrow "C" - Interpolated color.  (Use 'FaceColor' and 'FaceVertexCData'.)
%           - Special case shape:  Triangle.
davinci( 'arrow', 'X',               [ 3 22], ...
                  'Y',               [-6 -6], ...
                  'Head.Length',     19, ...
                  'Head.Width',      3, ...
                  'Head.Sweep',      0, ...
                  'Shaft.Width',     3, ...
                  'FaceVertexCData', [ [1 1 0];        % Vertex #1.  Yellow.
                                       [1 0 0];        % Vertex #2.  Red.
                                       [1 1 0] ], ...  % Vertex #3.  Yellow.
                  'FaceColor',       'interp' );

% Arrow "D" - Interpolated color.  (Use 'FaceColor' and 'FaceVertexCData'.)
%           - Double arrow.
%           - Include red rim.  (Use 'EdgeColor'.)    
davinci( 'arrow', 'X',               [ 0 25], ...
                  'Y',               [-12 -12], ...
                  'ArrowType',       'double', ...
                  'Head.Length',     5, ...
                  'Head.Width',      6, ...
                  'Head.Sweep',      2, ...
                  'Shaft.Width',     1, ...
                  'FaceVertexCData', [ [1 0 0];        % Vertex #1.  Red.
                                       [1 0 0];        % Vertex #2.  Red.
                                       [1 1 0];        % Vertex #3.  Yellow.
                                       [1 1 0];        % Vertex #4.  Yellow.
                                       [1 1 0];        % Vertex #5.  Yellow.
                                       [1 0 0];        % Vertex #6.  Red.
                                       [1 0 0];        % Vertex #7.  Red.
                                       [1 1 0];        % Vertex #8.  Yellow.
                                       [1 1 0];        % Vertex #9.  Yellow.
                                       [1 1 0] ], ...  % Vertex #10. Yellow.
                  'FaceColor',       'interp', ...
                  'EdgeColor',       'r' );

daspect( [1 1 1] )
hold off