Render.GetSurfaceColor

From GMod Wiki

Jump to: navigation, search
Function
Syntax Render.GetSurfaceColor( Vector StartPos, Vector EndPos )
Where is this used?
Description:
Returns the normalized surface color.
Returns: Table :Color
Part of Library: render
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Render.GetSurfaceColor]Render.GetSurfaceColor [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThis will output the color the player is looking at.
Used onNewerClient.png
Code
 
	local eyepos = LocalPlayer():EyePos()
	local aim = LocalPlayer():GetAimVector()
 
	local color = render.GetSurfaceColor(eyepos, eyepos + aim * 5000) * 255
	print(color)
 
OutputColor: (36.6491, 37.5861, 38.3393)


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox