Results 1 to 5 of 5

Thread: Web colours for vb6

  1. #1

    Thread Starter
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    686

    Post Web colours for vb6

    hi here is a class that allows you to use web colors in your apps easy to use just plug into your project and your good to go hope you like it.

    class code

    Code:
    VERSION 1.0 CLASS
    BEGIN
      MultiUse = -1  'True
      Persistable = 0  'NotPersistable
      DataBindingBehavior = 0  'vbNone
      DataSourceBehavior  = 0  'vbNone
      MTSTransactionMode  = 0  'NotAnMTSObject
    END
    Attribute VB_Name = "cWebColors"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = True
    Attribute VB_PredeclaredId = False
    Attribute VB_Exposed = False
    
    Public Enum vbWebColors
        vbsnow = &HFAFAFF
        vbFloralWhite = &HF0FAFF
        vbLavenderBlush = &HF5F0FF
        vbOldLace = &HE6F5FD
        vbIvory = &HF0FFFF
        vbCornSilk = &HDCF8FF
        vbBeige = &HDCF5F5
        vbAntiqueWhite = &HD7EBFA
        vbWheat = &HB3DEF5
        vbAliceBlue = &HFFF8F0
        vbGhostWhite = &HFFF8F8
        vbLavender = &HFAE6E6
        vbSeashell = &HEEF5FF
        vbLightYellow = &HE0FFFF
        vbPapayaWhip = &HD5EFFF
        vbNavajoWhite = &HADDEFF
        vbMoccasin = &HB5E4FF
        vbBurlywood = &H87B8DE
        vbAzure = &HFFFFF0
        vbMintcream = &HFAFFF5
        vbHoneydew = &HF0FFF0
        vbLinen = &HE6F0FA
        vbLemonChiffon = &HCDFAFF
        vbBlanchedAlmond = &HCDEBFF
        vbBisque = &HC4E4FF
        vbPeachPuff = &HB9DAFF
        vbTan = &H8CB4D2
        vbYellow = &HFFFF&
        vbDarkOrange = &H8CFF&
        vbRed = &HFF&
        vbDarkRed = &H8B&
        vbMaroon = &H80&
        vbIndianRed = &H5C5CCD
        vbSalmon = &H7280FA
        vbCoral = &H507FFF
        vbGold = &HD7FF&
        vbTomato = &H4763FF
        vbCrimson = &H3C14DC
        vbBrown = &H2A2AA5
        vbChocolate = &H1E69D2
        vbSandyBrown = &H60A4F4
        vbLightSalmon = &H7AA0FF
        vbLightCoral = &H8080F0
        vbOrange = &HA5FF&
        vbOrangeRed = &H45FF&
        vbFirebrick = &H2222B2
        vbSaddleBrown = &H13458B
        vbSienna = &H2D52A0
        vbPeru = &H3F85CD
        vbDarkSalmon = &H7A96E9
        vbRosyBrown = &H8F8FBC
        vbPaleGoldenrod = &HAAE8EE
        vbLightGoldenrodYellow = &HD2FAFA
        vbOlive = &H8080&
        vbForestGreen = &H228B22
        vbGreenYellow = &H2FFFAD
        vbChartreuse = &HFF7F&
        vbLightGreen = &H90EE90
        vbAquamarine = &HD4FF7F
        vbSeaGreen = &H578B2E
        vbGoldenRod = &H20A5DA
        vbKhaki = &H8CE6F0
        vbOliveDrab = &H238E6B
        vbGreen = &H8000&
        vbYellowGreen = &H32CD9A
        vbLawnGreen = &HFC7C&
        vbPaleGreen = &H98FB98
        vbMediumAquamarine = &HAACD66
        vbMediumSeaGreen = &H71B33C
        vbDarkGoldenRod = &HB86B8
        vbDarkKhaki = &H6BB7BD
        vbDarkOliveGreen = &H2F6B55
        vbDarkgreen = &H6400&
        vbLimeGreen = &H32CD32
        vbLime = &HFF00&
        vbSpringGreen = &H7FFF00
        vbMediumSpringGreen = &H9AFA00
        vbDarkSeaGreen = &H8FBC8F
        vbLightSeaGreen = &HAAB220
        vbPaleTurquoise = &HEEEEAF
        vbLightCyan = &HFFFFE0
        vbLightBlue = &HE6D8AD
        vbLightSkyBlue = &HFACE87
        vbCornFlowerBlue = &HED9564
        vbDarkBlue = &H8B0000
        vbIndigo = &H82004B
        vbMediumTurquoise = &HCCD148
        vbTurquoise = &HD0E040
        vbCyan = &HFFFF00
        vbAqua = &HFFFF00
        vbPowderBlue = &HE6E0B0
        vbSkyBlue = &HEBCE87
        vbRoyalBlue = &HE16941
        vbMediumBlue = &HCD0000
        vbMidnightBlue = &H701919
        vbDarkTurquoise = &HD1CE00
        vbCadetBlue = &HA09E5F
        vbDarkCyan = &H8B8B00
        vbTeal = &H808000
        vbDeepskyBlue = &HFFBF00
        vbDodgerBlue = &HFF901E
        vbBlue = &HFF0000
        vbNavy = &H800000
        vbDarkViolet = &HD30094
        vbDarkOrchid = &HCC3299
        vbMagenta = &HFF00FF
        vbFuchsia = &HFF00FF
        vbDarkMagenta = &H8B008B
        vbMediumVioletRed = &H8515C7
        vbPaleVioletRed = &H9370DB
        vbBlueViolet = &HE22B8A
        vbMediumOrchid = &HD355BA
        vbMediumPurple = &HDB7093
        vbPurple = &H800080
        vbDeepPink = &H9314FF
        vbLightPink = &HC1B6FF
        vbViolet = &HEE82EE
        vbOrchid = &HD670DA
        vbPlum = &HDDA0DD
        vbThistle = &HD8BFD8
        vbHotPink = &HB469FF
        vbPink = &HCBC0FF
        vbLightSteelBlue = &HDEC4B0
        vbMediumSlateBlue = &HEE687B
        vbLightSlateGray = &H998877
        vbWhite = &HFFFFFF
        vbLightgrey = &HD3D3D3
        vbGray = &H808080
        vbSteelBlue = &HB48246
        vbSlateBlue = &HCD5A6A
        vbSlateGray = &H908070
        vbWhiteSmoke = &HF5F5F5
        vbSilver = &HC0C0C0
        vbDimGray = &H696969
        vbMistyRose = &HE1E4FF
        vbDarkSlateBlue = &H8B3D48
        vbDarkSlategray = &H4F4F2F
        vbGainsboro = &HDCDCDC
        vbDarkGray = &HA9A9A9
        vbBlack = &H0&
    End Enum
    
    Public Property Get GetColor(ColorName As vbWebColors) As OLE_COLOR
        GetColor = ColorName
    End Property
    how to use the class

    Code:
    Dim webcolors As New cWebColors
    
    Private Sub Command1_Click()
        Me.BackColor = webcolors.GetColor(vbsnow)
    End Sub

  2. #2
    Fanatic Member
    Join Date
    Aug 2011
    Location
    Palm Coast, FL
    Posts
    551

    Re: Web colours for vb6

    Hi Ben,

    Educate me please... What makes a color a "web color" vs just a regular color?

  3. #3
    New Member
    Join Date
    Oct 2016
    Posts
    1

    Re: Web colours for vb6

    Check this.

  4. #4
    Fanatic Member
    Join Date
    Aug 2011
    Location
    Palm Coast, FL
    Posts
    551

    Re: Web colours for vb6

    Thank you

  5. #5

    Thread Starter
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    686

    Re: Web colours for vb6

    Quote Originally Posted by AAraya View Post
    Hi Ben,

    Educate me please... What makes a color a "web color" vs just a regular color?
    No different just VB6 does not display web color names just a few default ones. I thought this be usfull for people that use web color names a lot as an extra for VB

    Glad you like this class

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width