Ok, well I kindo got it working excpet that the colours are 1 down the scale
from what they should be. ie 0 = red, 1 = yellow, etc
Function ACIRed(ByRef ACI As Integer) As Integer
Dim Red As Object
Red = New Object() {1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0.65, 0.65,
0.5, 0.5, 0.3, 0.3, 0.15, 0.15, 1, 1, 0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15,
0.15, 1, 1, 0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15, 0.15, 1, 1, 0.65, 0.65,
0.5, 0.5, 0.3, 0.3, 0.15, 0.15, 1, 1, 0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15,
0.15, 0.75, 0.875, 0.4875, 0.56875, 0.375, 0.4375, 0.225, 0.2625, 0.1125,
0.13125, 0.5, 0.75, 0.325, 0.4875, 0.25, 0.375, 0.15, 0.225, 0.075, 0.1125,
0.25, 0.625, 0.1625, 0.40625, 0.125, 0.3125, 0.075, 0.1875, 0.0375, 0.09375,
0, 0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0, 0.075, 0, 0.5, 0, 0.325, 0, 0.25, 0,
0.15, 0, 0.075, 0, 0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0, 0.075, 0, 0.5, 0,
0.325, 0, 0.25, 0, 0.15, 0, 0.075, 0, 0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0,
0.075, 0, 0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0, 0.075, 0, 0.5, 0, 0.325, 0,
0.25, 0, 0.15, 0, 0.075, 0, 0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0, 0.075, 0,
0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0, 0.075, 0.25, 0.625, 0.1625, 0.40625,
0.125, 0.3125, 0.075, 0.1875, 0.0375, 0.09375, 0.5, 0.75, 0.325, 0.4875,
0.25, 0.375, 0.15, 0.225, 0.075, 0.1125, 0.75, 0.875, 0.4875, 0.56875,
0.375, 0.4375, 0.225, 0.2625, 0.1125, 0.13125, 1, 1, 0.65, 0.65, 0.5, 0.5,
0.3, 0.3, 0.15, 0.15, 1, 1, 0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15, 0.15, 1,
1, 0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15, 0.15, 1, 1, 0.65, 0.65, 0.5, 0.5,
0.3, 0.3, 0.15, 0.15, 0.33, 0.464, 0.598, 0.732, 0.866, 1}
Return Red(ACI) * 255
End Function
Function ACIBlue(ByRef ACI As Integer) As Integer
Dim Blue As Object
Blue = New Object() {0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0.5, 0, 0.325, 0,
0.25, 0, 0.15, 0, 0.075, 0, 0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0, 0.075, 0,
0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0, 0.075, 0, 0.5, 0, 0.325, 0, 0.25, 0,
0.15, 0, 0.075, 0, 0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0, 0.075, 0, 0.5, 0, 0.3
25, 0, 0.25, 0, 0.15, 0, 0.075, 0, 0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0,
0.075, 0, 0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0, 0.075, 0, 0.5, 0, 0.325, 0,
0.25, 0, 0.15, 0, 0.075, 0.25, 0.625, 0.1625, 0.40625, 0.125, 0.3125, 0.075,
0.1875, 0.0375, 0.09375, 0.5, 0.75, 0.325, 0.4875, 0.25, 0.375, 0.15, 0.225,
0.075, 0.1125, 0.75, 0.875, 0.4875, 0.56875, 0.375, 0.4375, 0.225, 0.2625,
0.1125, 0.13125, 1, 1, 0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15, 0.15, 1, 1,
0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15, 0.15, 1, 1, 0.65, 65, 0.5, 0.5, 0.3,
0.3, 0.15, 0.15, 1, 1, 0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15, 0.15, 1, 1,
0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15, 0.15, 1, 1, 0.65, 0.65, 0.5, 0.5, 0.3,
0.3, 0.15, 0.15, 1, 1, 0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15, 0.15, 1, 1,
0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15, 0.15, 1, 1, 0.65, 0.65, 0.5, 0.5, 0.3,
0.3, 0.15, 0.15, 0.75, 0.875, 0.4875, 0.56875, 0.375, 0.4375, 0.225, 0.2625,
0.1125, 0.13125, 0.5, 0.75, 0.325, 0.4875, 0.25, 0.375, 0.15, 0.225, 0.075,
0.1125, 0.25, 0.625, 0.1625, 0.40625, 0.125, 0.3125, 0.075, 0.1875, 0.0375,
0.09375, 0.33, 0.464, 0.598, 0.732, 0.866, 1}
Return Blue(ACI) * 255
End Function
Function ACIGreen(ByRef ACI As Integer) As Integer
Dim Green As Object
Green = New Object() {0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0.5, 0, 0.325,
0, 0.25, 0, 0.15, 0, 0.075, 0.25, 0.625, 0.1625, 0.40625, 0.125, 0.3125,
0.075, 0.1875, 0.0375, 0.09375, 0.5, 0.75, 0.325, 0.4875, 0.25, 0.375, 0.15,
0.225, 0.075, 0.1125, 0.75, 0.875, 0.4875, 0.56875, 0.375, 0.4375, 0.225,
0.2625, 0.1125, 0.13125, 1, 1, 0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15, 0.15,
1, 1, 0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15, 0.15, 1, 1, 0.65, 0.65, 0.5,
0.5, 0.3, 0.3, 0.15, 0.15, 1, 1, 0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15, 0.15,
1, 1, 0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15, 0.15, 1, 1, 0.65, 0.65, 0.5,
0.5, 0.3, 0.3, 0.15, 0.15, 1, 1, 0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15, 0.15,
1, 1, 0.65, 0.65, 0.5, 0.5, 0.3, 0.3, 0.15, 0.15, 1, 1, 0.65, 0.65, 0.5,
0.5, 0.3, 0.3, 0.15, 0.15, 0.75, 0.875, 0.4875, 0.56875, 0.375, 0.4375,
0.225, 0.2625, 0.1125, 0.13125, 0.5, 0.75, 0.325, 0.4875, 0.25, 0.375, 0.15,
0.225, 0.075, 0.1125, 0.25, 0.625, 0.1625, 0.40625, 0.125, 0.3125, 0.075,
0.1875, 0.0375, 0.09375, 0, 0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0, 0.075, 0,
0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0, 0.075, 0, 0.5, 0, 0.325, 0, 0.25, 0,
0.15, 0, 0.075, 0, 0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0, 0.075, 0, 0.5, 0,
0.325, 0, 0.25, 0, 0.15, 0, 0.075, 0, 0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0,
0.075, 0, 0.5, 0, 0.325, 0, 0.25, 0, 0.15, 0, 0.075, 0, 0.5, 0, 0.325, 0,
0.25, 0, 0.15, 0, 0.075, 0.33, 0.464, 0.598, 0.732, 0.866, 1}
Return Green(ACI) * 255
End Function
Private Sub nudACI_ValueChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles nudACI.ValueChanged
On Error Resume Next
Me.nudACI.BackColor = Color.FromArgb(255, _
ACIRed(CInt(Me.nudACI.Value)), _
ACIGreen(CInt(Me.nudACI.Value)), _
ACIBlue(CInt(Me.nudACI.Value)))
End Sub
"Russ Green" wrote in message
news:D1F8BE90D4633C62355DEE34B7E729A0@in.WebX.maYIadrTaRb...
> I have a text box on a form and I would like users to type in the color
> number and have the backgound color of the textbox change to display this
> color.
>
> Any ideas?
>
> Russ
>
>