# surface.SetTextColor

- **Ortam:** İstemci, Menü
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/surface.SetTextColor
- **Çeviri tarihi:** 2026-05-14

```lua
surface.SetTextColor( number r, number g, number b, number a = 255 )
```

```lua
surface.SetTextColor( Color color )
```

## Açıklama

Çizilecek herhangi bir gelecekteki metnin rengini ayarlamak, ya ayrı rakamlar olarak R, G, B ve A kullanarak veya [Renk](https://gmod.tr/wiki/Color).

## Varsayılan argümanlar

1.. [numara](https://gmod.tr/wiki/number) **r**: Renklerin kırmızı değeri.
2.. [numara](https://gmod.tr/wiki/number) **g**: Rengin yeşil değeri
3.. [numara](https://gmod.tr/wiki/number) **b**: Mavi renk değeri
4.. [numara](https://gmod.tr/wiki/number) **a)** = 255: Rengin alfa değeri

Argument Aşırı yükleme: Renk nesnesi kullanın

1.. [Renk](https://gmod.tr/wiki/Color) **Renkli**: A. [Renk](https://gmod.tr/wiki/Color) Bu dört sayı vermekten daha yavaş. [Color:Unpack](https://gmod.tr/wiki/Color:Unpack) Performans nedenleriyle kullanmak istiyorsanız renk nesneleri de önbelleğe almanız gerekir.

### Örnek

Ekranın sol üst kısmında beyaz renkte "Merhaba Dünya" çizer.

```lua
hook.Add( "HUDPaint", "HUDPaint_DrawABox", function()
	surface.SetDrawColor( 0, 0, 0, 128 ) -- Arkaplan için renk ayarlayın
	surface.DrawRect( 100, 100, 128, 20 ) -- Arkaplan çiz

	surface.SetTextColor( 255, 255, 255 ) -- Metin rengini ayarla
	surface.SetTextPos( 136, 104 ) -- Metin konumu ayarlayın, sol üst köşede
	surface.SetFont( "Default" ) -- Yazıtipi ayarlayın
	surface.DrawText( "Hello World" ) -- Metni çiz.
end )
```

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/surface.SetTextColor
