SetColor

The SetColor function sets the specified color in the palette.

SetColor nColor, nRed, nGreen, nBlue

Parameters

nColor
The number of color entry in the palette to set.

nRed
The red component of the color. Valid values are between and including 0 and 255.

nGreen
The green component of the color. Valid values are between and including 0 and 255.

nBlue
The blue component of the color. Valid values are between and including 0 and 255.

Remarks

Example
View result

<%@ Language=VBScript %>
<%
Response.ContentType="image/gif"
set obj=Server.CreateObject("shotgraph.image")

size=400
obj.CreateImage size,size,256
obj.SetColor 0,255,255,255
obj.SetBgColor 0
obj.FillRect 0,0,size-1,size-1
for i=1 to 199
	obj.SetColor i,0,0,i
	obj.SetDrawColor i
	obj.Line 1,i*2-1,size-2,i*2-1
	obj.Line 1,i*2,size-2,i*2
next
obj.SetTextColor 0
obj.SetBkMode "TRANSPARENT"
obj.SetTextAlign "TA_CENTER","TA_BASELINE"
obj.CreateFont "Times New Roman",0,90,0,True,False,False,False
obj.TextOut size/2,size/2,"256 colors"
obj.BuildPalette 200

img=obj.GifImage(-1,1,"")
Response.BinaryWrite(img)
%>