function [G Y]= labDifference(gren, yelow, laf) %D3

green = rgb2lab(gren);
yellow = rgb2lab(yelow);
leaf = rgb2lab(laf);


d1 = sqrt((green(1)- leaf(1)).^2 + (green(2) - leaf(2)).^2 + (green(3) - leaf(3)).^2);       % leaf distance from green
d2 = sqrt((yellow(1)- leaf(1)).^2 + (yellow(2) - leaf(2)).^2 + (yellow(3) - leaf(3)).^2) ;    % leaf distance from yellow


G = 100 *(1- (d1/ (d1+d2)));       %Green percentage
Y = 100 *(1- (d2/(d1+d2)));        %Yellow percentage
