This document is a project report by Rahul Singodiya on color palettes for his Bachelor of Computer Application degree. It includes an acknowledgment thanking those who helped with the project. It then provides code in VBA for a color palette application with scroll bars to select RGB values and display the corresponding hex code. The code converts the decimal RGB values to hexadecimal values and concatenates them to display the full hex code for the selected color.
2. Project report on
COLOR PALETTE
Submitted To
Dezyne E’cole College
Towards
The Partial Fulfillment
Of Second Year, Bachelor of Computer Application
By
Rahul Singodiya
Dezyne E,cole College
106/10, Civil Line, Ajmer
www.dezyneecole.com
3. Acknowledgment
I am Rahul Singodiya student of Bachelor of Computer
Application Dezyne E’Cole College would like to express my
gratitude to each and every person who has contributed in
stimulating suggestions and encouragement which really
helped me to coordinate my project.
I also thank Dezyne E’Cole College who provided insight and
expertise that greatly assisted the project. Also, a special
thanks to my teacher, parents and colleagues who have
supported me at every step.
Not to forget, the almighty who blessed me with good health
because of which I worked more efficiently and better.
4.
5.
6.
7.
8. Dim a(2), b(2), c(2) As Variant
Dim h(6) As Variant
Private Sub VScroll1_change()
Call Vsone
End Sub
Private Sub VScroll1_Scroll()
Call Vsone
End Sub
Private Sub VScroll2_Change()
Call Vsone
End Sub
Private Sub VScroll2_Scroll()
Call Vsone
End Sub
Private Sub VScroll3_Change()
Call Vsone
End Sub
CODE
9. Sub Vsone()
Form1.BackColor = RGB(VScroll1.Value, VScroll2.Value,
VScroll3.Value)
Text2.Text = VScroll1.Value
Text3.Text = VScroll2.Value
Text4.Text = VScroll3.Value
t1 = VScroll1.Value
t2 = VScroll2.Value
t3 = VScroll3.Value
Text1.Text = ""
i = 0
If t1 < 16 Then
a(1) = 0
End If
If t2 < 16 Then
b(1) = 0
End If
If t3 < 16 Then
c(1) = 0
End If
10. While t1 <> 0
a(i) = t1 Mod 16
b(i) = t2 Mod 16
c(i) = t3 Mod 16
t1 = t1 16
t2 = t2 16
t3 = t3 16
i = i + 1
Wend
i = 1
While i >= 0
t1 = a(i)
If t1 = 10 Then
a(i) = "A"
ElseIf t1 = 11 Then
a(i) = "B"
ElseIf t1 = 12 Then
a(i) = "C"
ElseIf t1 = 13 Then
a(i) = "D"
ElseIf t1 = 14 Then
a(i) = "E"
11. ElseIf t1 = 15 Then
a(i) = "F"
Else
a(i) = t1
End If
i = i - 1
Wend
i = 1
While i >= 0
t2 = b(i)
If t2 = 10 Then
b(i) = "A"
ElseIf t2 = 11 Then
b(i) = "B"
ElseIf t2 = 12 Then
b(i) = "C"
ElseIf t2 = 13 Then
b(i) = "D"
ElseIf t2 = 14 Then
b(i) = "E"
ElseIf t2 = 15 Then
b(i) = "F"
12. Else
b(i) = t2
End If
i = i - 1
Wend
i = 1
While i >= 0
t3 = c(i)
If t3 = 10 Then
c(i) = "A"
ElseIf t3 = 11 Then
c(i) = "B"
ElseIf t3 = 12 Then
c(i) = "C"
ElseIf t3 = 13 Then
c(i) = "D"
ElseIf t3 = 14 Then
c(i) = "E"
ElseIf t3 = 15 Then
c(i) = "F"
13. Else
c(i) = t3
End If
i = i - 1
Wend
h(0) = Format(a(1), "0")
h(1) = a(0)
h(2) = b(1)
h(3) = b(0)
h(4) = c(1)
h(5) = c(0)
Text1.Text = "#"
i = 0
While i <= 5
Text1.Text = Text1.Text & h(i)
i = i + 1
Wend
End Sub
14. THANK YOU
Created By: Rahul Singodiya
Bachelor of Computer Application
Dezyne E’cole College, Ajmer