Convert HTML Color to RGB

Level:
Level1

In this day and age you will find yourself at times needing to set a color in two different ways. If you are doing any sort of web development you will find that often you are referring to colors using a code that looks something like this '#0066FF'. On the other hand if you are doing development in Visual Basic it expects you to specify any colors by their Red, Green, and Blue values (hence RGB). Luckily you can write a simple code snippet to convert HTML colors into their RGB equivalents.

To do this creat a new Visual Basic application. Add a command button to it. Double click this button. Highlight everything in the code editor and delete it. Replace it with this code.

  1. Function HTMLtoRGB(HtmlCode As String) As String
  2.         If Left(HtmlCode, 1) = "#" Then
  3.                 HtmlCode = Right(HtmlCode, 6)
  4.         End If
  5.  
  6.         RED = Left(HtmlCode, 2)
  7.         GREEN = Mid(HtmlCode, 3, 2)
  8.         BLUE = Right(HtmlCode, 2)
  9.         RgbHex = "&H00" + BLUE + GREEN + RED
  10.         HTMLtoRGB = "&" & Val(RgbHex)
  11. End Function
  12.  
  13. Private Sub Command1_Click()
  14.     MsgBox HTMLtoRGB("0000FF")
  15. End Sub

Once you add the source code run the program and hit the command button. You will see your HTML color converted to a Red Green Blue equivalent.

Note: The source for this was found at DreamVB which is no longer online.

If you enjoyed this post, subscribe for updates (it's free)

red bottom shoes

But by far, the very best point about as a result grant is the fact that the college students will never ever must pay the funds back ever again The louis vuitton outlet online shopping cart software is one essential software program on the ecommerce website also it no longer can do with out them We want our teeth since the louis vuitton outlet place to start for breaking down food and it is nutrients Company vehicles We all see vehicles with company names and telephone numbers on them traveling our michael kors outlet streets and motorways These jobs can assist the person to earn additional other than what he or she normally earns The human resource consultant features a constantly michael kors transforming part This means being aware of your body and the changes it will go through over the 40 weeks of the pregnancyWash clean pipesSlow and clogged michael kors outlet drains can be very problematic Think about this carefully before finalizing your decision on the purchase of a laminatorJust as one added bonus, those that want automation louis vuitton purses without a great deal of computerized features may be thrilled with the simplicity on this powerful machine People that like sewing must have definitely found out about cheap louis vuitton bags Singer Sewing Machines Antique due to the quality machines they are providing from a while Be wary of hiring any builder that is not registered with any louis vuitton store developing association Eventually, they will take their profit louis vuitton handbags at the first sign of green in their bank account even though the trade is still strong and will continue to provide more profitYou do not need to be an expert in sales because all of the information you need to know about affiliate marketing is free online louis vuitton handbags From this point, purchasers are lured to use their credit cards, which accounts to about half of all of the costs, which is more than $50, of michael kors purses the average consumer Most Toronto boosting companies are also Toronto towing companies, working with both services regularly It was founded by Jay Kubassek, the Canadian entrepreneur who christian louboutin shoes outlet cofounded the Carbon Copy Pro a stepbystep marketing strategy system that was meant to coach the users to topics such as debt management, credit restoration, asset protection, michael kors handbags increase cash flow by minimizing taxes and so on In today's homes, where maximizing space is extremely important for the garage is no longer a forgotten place Christian Louboutin online of storage back Web purchasing for your each promotional product and corporate wearable needs is the successful wave of the future In the Forex market, it is Louis Vuitton Sale fundamentally the ratio of the amount used in a trade to the required security deposit needed, through the particular broker you choose to use, for that trade louis vuitton outlet If you often experience these problems in your kitchen and you always call a plumber to take care of your plumbing needs, you probably spent a huge Authentic Louis Vuitton Handbags amount of money at the expense of the plumbers You can find particular applications and computer software which you can't use on your Apple devices, and that gucci outlet is why you will need an Absinthe download A lease, whether it was started by you or sold to you by a tenerife business for sale, can't louis vuitton outlet online be easily ended in any case other than nonpayment of the rentCanada storage is a great option both for households and businesses This can yield a listing gucci of IT professionals that supply offerings that the company especially needs

all about vb 6

please help me all about coding on vb 6

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.