Hi, i've been trying to make a mod that doesn't require the default colorset to work properly, but I don't know how I can get the darkest color from the given color set. I looked in the duplicator's script and found this:
function determineBrightestColor()
{
%target = "1 1 1 1";
for(%i = 0; %i < 64; %i++)
{
%colori = getColorIdTable(%i);
%dist = vectorDist(%colori, %target);
if(%dist < %best || %best $= "")
{
%best = %dist;
$Duplicator::HighlightColor = %i;
}
}
}
I cannot understand it. Can someone help?