home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
- Begin VB.Form frmColorPicker
- BorderStyle = 3 'Fixed Dialog
- Caption = "Color Scheme ..."
- ClientHeight = 5235
- ClientLeft = 150
- ClientTop = 435
- ClientWidth = 3225
- ControlBox = 0 'False
- Icon = "frmMain.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5235
- ScaleWidth = 3225
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 'CenterScreen
- Begin VB.PictureBox Picture1
- BackColor = &H00400040&
- Height = 255
- Index = 29
- Left = 5040
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 68
- Top = 2520
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00800080&
- Height = 255
- Index = 28
- Left = 4680
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 67
- Top = 2520
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00C000C0&
- Height = 255
- Index = 27
- Left = 4320
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 66
- Top = 2520
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00FFFFC0&
- Height = 255
- Index = 49
- Left = 3240
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 65
- Top = 1800
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00FFFF80&
- Height = 255
- Index = 48
- Left = 3600
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 64
- Top = 1800
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00FFFF00&
- Height = 255
- Index = 47
- Left = 3960
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 63
- Top = 1800
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00C0C000&
- Height = 255
- Index = 46
- Left = 4320
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 62
- Top = 1800
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00808000&
- Height = 255
- Index = 45
- Left = 4680
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 61
- Top = 1800
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00FF8080&
- Height = 255
- Index = 44
- Left = 3600
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 60
- Top = 2160
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00FF0000&
- Height = 255
- Index = 43
- Left = 3960
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 59
- Top = 2160
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00C00000&
- Height = 255
- Index = 42
- Left = 4320
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 58
- Top = 2160
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00800000&
- Height = 255
- Index = 41
- Left = 4680
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 57
- Top = 2160
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00FFC0FF&
- Height = 255
- Index = 40
- Left = 3240
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 56
- Top = 2520
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00FF80FF&
- Height = 255
- Index = 39
- Left = 3600
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 55
- Top = 2520
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00FF00FF&
- Height = 255
- Index = 38
- Left = 3960
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 54
- Top = 2520
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00400000&
- Height = 255
- Index = 37
- Left = 5040
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 53
- Top = 2160
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00404000&
- Height = 255
- Index = 36
- Left = 5040
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 52
- Top = 1800
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00004000&
- Height = 255
- Index = 35
- Left = 5040
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 51
- Top = 1440
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00004040&
- Height = 255
- Index = 34
- Left = 5040
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 50
- Top = 1080
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00404080&
- Height = 255
- Index = 33
- Left = 5040
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 49
- Top = 720
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00FFC0C0&
- Height = 255
- Index = 32
- Left = 3240
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 48
- Top = 2160
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00000000&
- Height = 255
- Index = 26
- Left = 5040
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 47
- Top = 0
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00000040&
- Height = 255
- Index = 1
- Left = 5040
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 46
- Top = 360
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 25
- Left = 3240
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 45
- Top = 0
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00E0E0E0&
- Height = 255
- Index = 24
- Left = 3600
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 44
- Top = 0
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00C0C0C0&
- Height = 255
- Index = 23
- Left = 3960
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 43
- Top = 0
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00808080&
- Height = 255
- Index = 22
- Left = 4320
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 42
- Top = 0
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00404040&
- Height = 255
- Index = 21
- Left = 4680
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 41
- Top = 0
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H008080FF&
- Height = 255
- Index = 20
- Left = 3600
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 40
- Top = 360
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H000000FF&
- Height = 255
- Index = 19
- Left = 3960
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 39
- Top = 360
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H000000C0&
- Height = 255
- Index = 18
- Left = 4320
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 38
- Top = 360
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00000080&
- Height = 255
- Index = 17
- Left = 4680
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 37
- Top = 360
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00C0E0FF&
- Height = 255
- Index = 16
- Left = 3240
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 36
- Top = 720
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H0080C0FF&
- Height = 255
- Index = 15
- Left = 3600
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 35
- Top = 720
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H000080FF&
- Height = 255
- Index = 14
- Left = 3960
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 34
- Top = 720
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H000040C0&
- Height = 255
- Index = 13
- Left = 4320
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 33
- Top = 720
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00004080&
- Height = 255
- Index = 12
- Left = 4680
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 32
- Top = 720
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00C0FFFF&
- Height = 255
- Index = 11
- Left = 3240
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 31
- Top = 1080
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H0080FFFF&
- Height = 255
- Index = 10
- Left = 3600
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 30
- Top = 1080
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H0000FFFF&
- Height = 255
- Index = 9
- Left = 3960
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 29
- Top = 1080
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H0000C0C0&
- Height = 255
- Index = 8
- Left = 4320
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 28
- Top = 1080
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00008080&
- Height = 255
- Index = 7
- Left = 4680
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 27
- Top = 1080
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00C0FFC0&
- Height = 255
- Index = 6
- Left = 3240
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 26
- Top = 1440
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H0080FF80&
- Height = 255
- Index = 5
- Left = 3600
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 25
- Top = 1440
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H0000FF00&
- Height = 255
- Index = 4
- Left = 3960
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 24
- Top = 1440
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H0000C000&
- Height = 255
- Index = 3
- Left = 4320
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 23
- Top = 1440
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00008000&
- Height = 255
- Index = 2
- Left = 4680
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 22
- Top = 1440
- Width = 255
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00C0C0FF&
- Height = 255
- Index = 0
- Left = 3240
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 21
- Top = 360
- Width = 255
- End
- Begin VB.PictureBox PHEX
- BorderStyle = 0 'None
- Height = 615
- Left = 120
- ScaleHeight = 615
- ScaleWidth = 3135
- TabIndex = 18
- TabStop = 0 'False
- Top = 6240
- Width = 3135
- Begin VB.TextBox txtHex
- Height = 285
- Left = 0
- TabIndex = 19
- Text = "#FFFFFF"
- Top = 240
- Width = 1695
- End
- Begin VB.Label Label1
- Caption = "Hex Value"
- Height = 255
- Index = 5
- Left = 0
- TabIndex = 20
- Top = 0
- Width = 975
- End
- End
- Begin VB.PictureBox PLONG
- BorderStyle = 0 'None
- Height = 615
- Left = 120
- ScaleHeight = 615
- ScaleWidth = 3135
- TabIndex = 15
- TabStop = 0 'False
- Top = 5400
- Width = 3135
- Begin VB.TextBox txtLong
- Height = 285
- Left = 0
- TabIndex = 16
- Text = "12870716"
- Top = 240
- Width = 1695
- End
- Begin VB.Label Label1
- Caption = "Long Value"
- Height = 255
- Index = 4
- Left = 0
- TabIndex = 17
- Top = 0
- Width = 975
- End
- End
- Begin VB.PictureBox PRGB
- BorderStyle = 0 'None
- Height = 615
- Left = 120
- ScaleHeight = 615
- ScaleWidth = 3135
- TabIndex = 11
- Top = 3360
- Width = 3135
- Begin VB.TextBox txtR
- Height = 285
- Left = 0
- TabIndex = 1
- Text = "255"
- Top = 240
- Width = 855
- End
- Begin VB.TextBox txtB
- Height = 285
- Left = 2160
- TabIndex = 3
- Text = "255"
- Top = 240
- Width = 855
- End
- Begin VB.TextBox txtG
- Height = 285
- Left = 1080
- TabIndex = 2
- Text = "255"
- Top = 240
- Width = 855
- End
- Begin VB.Label Label1
- Caption = "Red"
- Height = 255
- Index = 0
- Left = 0
- TabIndex = 14
- Top = 0
- Width = 975
- End
- Begin VB.Label Label1
- Caption = "Green"
- Height = 255
- Index = 1
- Left = 1080
- TabIndex = 13
- Top = 0
- Width = 975
- End
- Begin VB.Label Label1
- Caption = "Blue"
- Height = 255
- Index = 2
- Left = 2160
- TabIndex = 12
- Top = 0
- Width = 975
- End
- End
- Begin MSComDlg.CommonDialog cmd
- Left = 720
- Top = 840
- _ExtentX = 847
- _ExtentY = 847
- _Version = 393216
- End
- Begin VB.CommandButton Command3
- Caption = ">>"
- Height = 375
- Left = 2760
- TabIndex = 6
- Top = 4800
- Width = 375
- End
- Begin VB.CommandButton Command2
- Caption = "&Cancel"
- Height = 375
- Left = 1440
- TabIndex = 5
- Top = 4800
- Width = 1215
- End
- Begin VB.CommandButton cmdOk
- Caption = "&OK"
- Height = 375
- Left = 120
- TabIndex = 4
- Top = 4800
- Width = 1215
- End
- Begin VB.PictureBox Light
- BackColor = &H00FFFFFF&
- Height = 2850
- Left = 2880
- MouseIcon = "frmMain.frx":0E42
- MousePointer = 99 'Custom
- ScaleHeight = 2790
- ScaleWidth = 165
- TabIndex = 9
- TabStop = 0 'False
- Top = 0
- Width = 230
- End
- Begin VB.PictureBox Picker1
- AutoSize = -1 'True
- BackColor = &H00FFFFFF&
- Height = 2850
- Left = 120
- MouseIcon = "frmMain.frx":114C
- MousePointer = 99 'Custom
- Picture = "frmMain.frx":1456
- ScaleHeight = 2790
- ScaleWidth = 2625
- TabIndex = 8
- TabStop = 0 'False
- Top = 0
- Width = 2685
- End
- Begin VB.PictureBox Picture4
- BackColor = &H00FFFFFF&
- Height = 435
- Left = 120
- ScaleHeight = 375
- ScaleWidth = 2925
- TabIndex = 7
- Top = 4200
- Width = 2985
- End
- Begin VB.PictureBox Picture3
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 255
- Left = 120
- MouseIcon = "frmMain.frx":19438
- MousePointer = 99 'Custom
- Picture = "frmMain.frx":19742
- ScaleHeight = 255
- ScaleWidth = 3000
- TabIndex = 0
- TabStop = 0 'False
- Top = 2880
- Width = 3000
- End
- Begin VB.Label Label1
- Caption = "Selected Color"
- Height = 255
- Index = 3
- Left = 120
- TabIndex = 10
- Top = 3960
- Width = 1575
- End
- Begin VB.Menu Shape
- Caption = "&Shape"
- Enabled = 0 'False
- Begin VB.Menu Sq
- Caption = "&Square Picker"
- End
- Begin VB.Menu Circle
- Caption = "&Circle Picker"
- End
- End
- Begin VB.Menu Format
- Caption = "&Format"
- Begin VB.Menu mnuRGB
- Caption = "&RGB Values"
- End
- Begin VB.Menu mnuHEX
- Caption = "&HEX Value"
- End
- Begin VB.Menu mnuLong
- Caption = "&Long Value"
- End
- End
- Attribute VB_Name = "frmColorPicker"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '# Color Picker v. 1.00.0 Copyright (C) 2000 Vladimir S. Pekulas
- '# If you are going to use this program, please include my credits.
- '# (C) 2000 Vladimir S. Pekulas
- '# http://www.BohemiaTrading.com
- '# vpekulas@home.com
- Public LongTransfer As Double 'Long
- Public HexTransfer As String 'Hex
- Public RTransfer As Double 'Red
- Public BTransfer As Double 'Blue
- Public GTransfer As Double 'Green
- Dim RGBValues(4) As Long
- Dim NowColor As Double
- Dim XTOP As Double, XLEFT As Double
- Private Sub cmdOk_Click()
- '# Save values for futher use
- LongTransfer = txtLong.Text
- HexTransfer = txtHex.Text
- RTransfer = txtR.Text
- GTransfer = txtG.Text
- BTransfer = txtB.Text
- '# Unload Form
- Unload Me
- End Sub
- Private Sub Command2_Click()
- Unload Me
- End Sub
- Private Sub Command3_Click()
- If Me.Width = 5490 Then
- Me.Width = 3315
- Else
- Me.Width = 5490
- End If
- End Sub
- Private Sub Form_Load()
- PLONG.Visible = False
- PHEX.Visible = False
- PRGB.Visible = True
- XTOP = PRGB.Top
- XLEFT = PRGB.Left
- PLONG.Visible = False
- PRGB.Visible = False
- PHEX.Visible = True
- PHEX.Top = XTOP
- PHEX.Left = XLEFT
- End Sub
- Private Sub mnuHEX_Click()
- PLONG.Visible = False
- PRGB.Visible = False
- PHEX.Top = XTOP
- PHEX.Left = XLEFT
- PHEX.Visible = True
- End Sub
- Private Sub mnuLong_Click()
- 'MsgBox "Note: Internet Browser can not use other the HEX value.", vbInformation
- PRGB.Visible = False
- PHEX.Visible = False
- PLONG.Top = XTOP
- PLONG.Left = XLEFT
- PLONG.Visible = True
- End Sub
- Private Sub mnuRGB_Click()
- 'MsgBox "Note: Internet Browser can not use other the HEX value.", vbInformation
- PLONG.Visible = False
- PHEX.Visible = False
- PRGB.Top = XTOP
- PRGB.Left = XLEFT
- PRGB.Visible = True
- End Sub
- Private Sub Light_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- On Error Resume Next
- If Button = 1 Then
- Picture4.BackColor = Light.Point(X, Y)
- NowColor = Picture4.BackColor
- txtLong.Text = NowColor
- RGBPicker
- HexColor
- End If
- End Sub
- Function HexColor() '#HEX Values
- HexRed = Hex$(txtR.Text)
- If Len(HexRed) = 1 Then HexRed = "0" & HexRed
- HexGreen = Hex$(txtG.Text)
- If Len(HexGreen) = 1 Then HexGreen = "0" & HexGreen
- HexBlue = Hex$(txtB.Text)
- If Len(HexBlue) = 1 Then HexBlue = "0" & HexBlue
- txtHex.Text = "#" & HexRed & HexGreen & HexBlue
- End Function
- Private Sub Picker1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- On Error Resume Next
- If Button = 1 Then
- Picker1.Cls
- Picture4.BackColor = Picker1.Point(X, Y)
- NowColor = Picture4.BackColor
- txtLong.Text = NowColor
- RGBPicker
- HexColor
- End If
- End Sub
- Private Sub Picker1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- On Error Resume Next
- If Button = 1 Then
- Picker1.Cls
- Picker1.DrawWidth = 2
- Picker1.ForeColor = vbWhite
- Picker1.Line (X, Y)-(X, Y - 120)
- Picker1.Line (X, Y)-(X - 120, Y)
- End If
- End Sub
- Private Sub Picture1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Button = 1 Then
- Picker1.Cls
- Picture4.BackColor = Picture1(Index).BackColor
- NowColor = Picture4.BackColor
- txtLong.Text = NowColor
- RGBPicker
- HexColor
- End If
- End Sub
- Private Sub Picture1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Button = 1 Then
- Picker1.Cls
- Picture4.BackColor = Picture1(Index).BackColor
- NowColor = Picture4.BackColor
- txtLong.Text = NowColor
- RGBPicker
- HexColor
- End If
- End Sub
- Private Sub Picture3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- On Error Resume Next
- If Button = 1 Then
- Picker1.Cls
- Picture4.BackColor = Picture3.Point(X, Y)
- NowColor = Picture4.BackColor
- txtLong.Text = NowColor
- RGBPicker
- HexColor
- End If
- End Sub
- '#Raster of NowColor and RGB values
- Function RGBPicker()
- RGBValues(3) = CLng(NowColor)
- RGBValues(0) = RGBValues(3) And 255
- RGBValues(1) = (RGBValues(3) And 65280) \ 256&
- RGBValues(2) = (RGBValues(3) And 16711680) \ 65535
- txtR.Text = RGBValues(0)
- txtG.Text = RGBValues(1)
- txtB.Text = RGBValues(2)
- Light.DrawWidth = 2
- P = 0
- For I = 1 To 254
- P = P + 13
- Light.ForeColor = RGB(RGBValues(0), RGBValues(1), I)
- Light.Line (0, P)-(245, P)
- Next I
- End Function
- Private Sub txtB_GotFocus()
- L = Len(txtB.Text)
- txtB.SelLength = L
- End Sub
- '# Blue of RGB
- Private Sub txtB_KeyDown(KeyCode As Integer, Shift As Integer)
- On Error Resume Next
- If KeyCode = 13 Then
- If txtB.Text > 255 Then '#0 to 255 only
- MsgBox "Number between 0 to 255 only!", vbInformation
- txtB.Text = 0
- Exit Sub
- End If
- If txtR.Text = "" Then txtR.Text = 0
- If txtG.Text = "" Then txtG.Text = 0
- If txtB.Text = "" Then txtB.Text = 0
- Picture4.BackColor = RGB(txtR.Text, txtG.Text, txtB.Text)
- Light.DrawWidth = 2
- P = 0
- For I = 1 To 254
- P = P + 13
- Light.ForeColor = RGB(txtR.Text, txtG.Text, I)
- Light.Line (0, P)-(245, P)
- Next I
- HexColor
- End If
- End Sub
- Private Sub txtG_GotFocus()
- L = Len(txtG.Text)
- txtG.SelLength = L
- End Sub
- '#Green of RGB
- Private Sub txtG_KeyDown(KeyCode As Integer, Shift As Integer)
- On Error Resume Next
- If KeyCode = 13 Then
- If txtG.Text > 255 Then '#0 to 255 only
- MsgBox "Number between 0 to 255 only!", vbInformation
- txtG.Text = 0
- Exit Sub
- End If
- If txtR.Text = "" Then txtR.Text = 0
- If txtG.Text = "" Then txtG.Text = 0
- If txtB.Text = "" Then txtB.Text = 0
- Picture4.BackColor = RGB(txtR.Text, txtG.Text, txtB.Text)
- Light.DrawWidth = 2
- P = 0
- For I = 1 To 254
- P = P + 13
- Light.ForeColor = RGB(txtR.Text, I, txtB.Text)
- Light.Line (0, P)-(245, P)
- Next I
- HexColor
- End If
- End Sub
- Private Sub txtR_GotFocus()
- L = Len(txtR.Text)
- txtR.SelLength = L
- End Sub
- '#Red of RGB
- Private Sub txtR_KeyDown(KeyCode As Integer, Shift As Integer)
- On Error Resume Next
- If KeyCode = 13 Then
- If txtR.Text > 255 Then '#0 to 255 only
- MsgBox "Number between 0 to 255 only!", vbInformation
- txtR.Text = 0
- Exit Sub
- End If
- If txtR.Text = "" Then txtR.Text = 0
- If txtG.Text = "" Then txtG.Text = 0
- If txtB.Text = "" Then txtB.Text = 0
- Picture4.BackColor = RGB(txtR.Text, txtG.Text, txtB.Text)
- Light.DrawWidth = 2
- P = 0
- For I = 1 To 254
- P = P + 13
- Light.ForeColor = RGB(I, txtG.Text, txtB.Text)
- Light.Line (0, P)-(245, P)
- Next I
- HexColor
- End If
- End Sub
-