if (gradient)
{
float min = sizePD + y0 / fontScale;
float max = sizePD + y1 / fontScale;
min /= sizePD;
max /= sizePD;
s_c0 = Color.Lerp(gb, gt, min);
s_c1 = Color.Lerp(gb, gt, max);
Color col_c0 = s_c0;
Color col_c1 = s_c1;
col_c0 *= 0.49f;
col_c1 *= 0.49f;
switch (glyph.channel)
{
case 1: col_c0.b += 0.51f; col_c1.b += 0.51f; break;
case 2: col_c0.g += 0.51f; col_c1.g += 0.51f; break;
case 4: col_c0.r += 0.51f; col_c1.r += 0.51f; break;
case 8: col_c0.a += 0.51f; col_c1.a += 0.51f; break;
}
s_c0 = col_c0;
s_c1 = col_c1;
for (int j = 0, jmax = (bold ? 4 : 1); j < jmax; ++j)
{
cols.Add(s_c0);
cols.Add(s_c1);
cols.Add(s_c1);
cols.Add(s_c0);
}
}
else
{
Color col = uc;
col *= 0.49f;
switch (glyph.channel)
{
case 1: col.b += 0.51f; break;
case 2: col.g += 0.51f; break;
case 4: col.r += 0.51f; break;
case 8: col.a += 0.51f; break;
}
Color32 c = col;
for (int j = 0, jmax = (bold ? 16 : 4); j < jmax; ++j)
cols.Add(c);
}