VB制作配色辅助小工具

项目中经常会用到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微信公众号,不定时推送物联网软硬件开发相关干货资料,白话硬件开发。




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值