Skip to content

Color API

Алексей . edited this page Oct 22, 2026 · 3 revisions

SFColor and SFColors live in SFSharp.Abstractions. No Runtime reference is needed. The primary numeric representation is ARGB (AARRGGBB); Rgba exposes RRGGBBAA.

FromHex accepts six-digit RGB or eight-digit ARGB. SampTag produces {RRGGBB} and Apply prefixes text with that tag. Alpha is not encoded in an inline SA-MP text tag, so WithAlpha does not make tagged text translucent. ToString uses #AARRGGBB; implicit uint conversion returns Argb.

Blend interpolates channels with a clamped 0..1 weight. The | operator means 50/50 blending, not bitwise OR or flag composition. Chaining three colors blends sequentially rather than equally.

Prefer the SFColor overload of Samp.Chat.Add when supplying line/prefix colors. See examples, implementation and chat contract.

Clone this wiki locally