Color32 ProcessFinalColor(Color32 old) { switch (mixMode) { case 1: return(TexUtility.MultiplyAlphaOnly(renderColor, old.a / 255f)); case 2: return(TexUtility.MultiplyColor(old, renderColor)); } return(renderColor); }
public override void Draw(DrawingContext drawingContext, float scale, float x, float y) { base.Draw(drawingContext, scale, x, y); float padding = TEXConfiguration.main.LinkMargin; var tint = drawingContext.DrawLink( new Rect((x - padding / 2f) * scale, (y - depth - padding / 2f) * scale, (width + padding) * scale, (totalHeight + padding) * scale), metaKey); TexContext.Color.Push(TexUtility.MultiplyColor(TexContext.Color.value, tint)); baseBox.Draw(drawingContext, scale, x, y); TexContext.Color.Pop(); }
public override void Draw(DrawingContext drawingContext, float scale, float x, float y) { switch (mixmode) { case 0: TexContext.Color.Push(color); break; case 1: TexContext.Color.Push(TexUtility.MultiplyAlphaOnly(color, TexContext.Color.value.a / 255f)); break; case 2: TexContext.Color.Push(TexUtility.MultiplyColor(TexContext.Color.value, color)); break; case 3: TexContext.Color.Pop(); break; } }
public override void Draw(DrawingContext drawingContext, float scale, float x, float y) { base.Draw(drawingContext, scale, x, y); float padding = TEXConfiguration.main.LinkMargin; var tint = drawingContext.DrawLink( new Rect((x - padding / 2f) * scale, (y - depth - padding / 2f) * scale, (width + padding) * scale, (totalHeight + padding) * scale), metaKey); if (tint == TexUtility.white) { baseBox.Draw(drawingContext, scale, x, y); } else { var oldColor = TexUtility.RenderColor; var newColor = TexUtility.MultiplyColor(oldColor, tint); TexUtility.RenderColor = newColor; baseBox.Draw(drawingContext, scale, x, y); TexUtility.RenderColor = oldColor; } }