<% Dim vValue, vR, vG, vB vR = Request("r") vG = Request("g") vB = Request("b") If vR = "" Then vR = "0" If vG = "" Then vG = "0" If vB = "" Then vB = "0" If cInt(vR) > 255 Then vR = 255 If cInt(vG) > 255 Then vG = 255 If cInt(vB) > 255 Then vB = 255 If cInt(vR) < 0 Then vR = 0 If cInt(vG) < 0 Then vG = 0 If cInt(vB) < 0 Then vB = 0 Session("pen_colour") = RGB(vR, vG, vB) %>
Colour Palette:
R:
G:
B:
Colour Preview:
<% Response.Write getHexValue(vR, vG, vB) %>
<% Function getHexValue(vR, vG, vB) If Len(Hex(vR)) = 1 Then getHexValue = "#0" & Hex(vR) Else getHexValue = "#" & Hex(vR) End If If Len(Hex(vG)) = 1 Then getHexValue = getHexValue & "0" & Hex(vG) Else getHexValue = getHexValue & Hex(vG) End If If Len(Hex(vB)) = 1 Then getHexValue = getHexValue & "0" & Hex(vB) Else getHexValue = getHexValue & Hex(vB) End If End Function %>