项目中经常会用到UI配色的问题,配色是一门学问,好的搭配可以带来不一样的用户体验。
貌似VB的界面配色一直以来都是大家所诟病的,有点单一死板,但是合理的界面配色也可以实现高大上的UI界面。
今天分享一个自己设计的开发辅助小工具,帮助设计人员选择颜色搭配,直接输出RGB值供程序开发使用。
直接上软件界面以及源代码:
源代码附上:
Option Explicit
Dim HexRed As String
Dim HexGreen As String
Dim HexBlue As String
Private Sub Form_Load()
Me.Show
HScroll1.Max = 255
HScroll2.Max = 255
HScroll3.Max = 255
HScroll1.Min = 0
HScroll2.Min = 0
HScroll3.Min = 0
Shape1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
HexRed = Hex(HScroll1.Value)
If Len(HexRed) < 2 Then
HexRed = "0" & HexRed
End If
HexGreen = Hex(HScroll2.Value)
If Len(HexGreen) < 2 Then
HexGreen = "0" & HexGreen
End If
HexBlue = Hex(HScroll3.Value)
If Len(HexBlue) < 2 Then
HexBlue = "0" & HexBlue
End If
Text1.Text = HScroll1.Value & "," & HScroll2.Value & "," & HScroll3.Value
Text2.Text = HexRed & HexGreen & HexBlue
End Sub
Private Sub HScroll1_Change()
Shape1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
HexRed = Hex(HScroll1.Value)
If Len(HexRed) < 2 Then
HexRed = "0" & HexRed
End If
HexGreen = Hex(HScroll2.Value)
If Len(HexGreen) < 2 Then
HexGreen = "0" & HexGreen
End If
HexBlue = Hex(HScroll3.Value)
If Len(HexBlue) < 2 Then
HexBlue = "0" & HexBlue
End If
Text1.Text = HScroll1.Value & "," & HScroll2.Value & "," & HScroll3.Value
Text2.Text = HexRed & HexGreen & HexBlue
End Sub
Private Sub HScroll2_Change()
Shape1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
HexRed = Hex(HScroll1.Value)
If Len(HexRed) < 2 Then
HexRed = "0" & HexRed
End If
HexGreen = Hex(HScroll2.Value)
If Len(HexGreen) < 2 Then
HexGreen = "0" & HexGreen
End If
HexBlue = Hex(HScroll3.Value)
If Len(HexBlue) < 2 Then
HexBlue = "0" & HexBlue
End If
Text1.Text = HScroll1.Value & "," & HScroll2.Value & "," & HScroll3.Value
Text2.Text = HexRed & HexGreen & HexBlue
End Sub
Private Sub HScroll3_Change()
Shape1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
HexRed = Hex(HScroll1.Value)
If Len(HexRed) < 2 Then
HexRed = "0" & HexRed
End If
HexGreen = Hex(HScroll2.Value)
If Len(HexGreen) < 2 Then
HexGreen = "0" & HexGreen
End If
HexBlue = Hex(HScroll3.Value)
If Len(HexBlue) < 2 Then
HexBlue = "0" & HexBlue
End If
Text1.Text = HScroll1.Value & "," & HScroll2.Value & "," & HScroll3.Value
Text2.Text = HexRed & HexGreen & HexBlue
End Sub
有兴趣的朋友可以到如下地址获取使用:
http://pan.baidu.com/s/1miOLxMw
访问密码请关注“博乐Bar”微信公众号,回复“VB配色”获取。
欢迎关注博乐Bar微信公众号,不定时推送物联网软硬件开发相关干货资料,白话硬件开发。