function triangle_ijk_fill ( i, j, k, r, color, label )

%*****************************************************************************80
%
%% triangle_ijk_fill plots a filled triangle.
%
%  Discussion:
%
%    If k = 0, the "ijk" triangle has vertices
%      (i-1,j-1), (i,j-1), (i-1,j).
%    If k = 1, the "ijk" triangle has vertices
%      (i,j), (i-1,j), (i,j-1).
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    06 September 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer I, J, K, the indices of the cell.
%
%    real R, a size factor for the triangles, between 0 and 1.
%
%    color COLOR, can be any of the 8 abbreviated color terms
%    'r', 'g', 'b', 'c', 'm', 'y', 'w', 'k', or an RGB triple such as 
%    [1.0,0.4,0.0].  The circle is filled with this color.
%
%    string LABEL: an optional label.
%
  [ x, y ] = triangle_ijk_to_xy ( i, j, k );

  xm = sum ( x ) / 3.0;
  ym = sum ( y ) / 3.0;

  x = r * x + ( 1.0 - r ) * xm;
  y = r * y + ( 1.0 - r ) * ym;

  fill ( x, y, color );

  if ( 0 < length ( label ) )
    text ( xm, ym, label );
  end

% fill ( x, y, color, 'EdgeColor', 'none' );

  return
end
