Results 1 to 11 of 11

Thread: hex colour

Threaded View

  1. #8
    Member
    Join Date
    Aug 2008
    Posts
    39

    Re: hex colour

    LaVolpe, I tried your code. It failed.

    I have 3 sliders that you use to choose your RGB value. One slider for R, one for G and the last for B.

    Anyway, I set the sliders to create a gold color and clicked the "OK" button, in which I put your code (from post #4).
    I have it like this:
    Code:
    Private Sub Command1_Click()
    Form1.Text13.Text = Right$("0000000" & Hex(RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)), 6)
    End Sub
    When I tried gold, and then used that code for
    Code:
    <font color="code here">blablabla</font>
    in a HTML document, it became dark TEAL and NOT gold!

    I tried the same with a yellow color (255,255,0) and it became LIGHT teal, and not yellow! What's the problem? I thought HTML used the same Hex codes.

    Edit: I asked my HTML teacher, and he noticed your code makes the HEX backwards! When I put my three sliders to create red, your HEX code turns it into "0000FF" and not "FF0000"

    Edit 2: And yes I am 100% sure I have put the sliders in the right order.

    Edit 3:
    As you might have understood, I want to be able to get a Hex code from a Visual Basics program to be able to copy/paste that code into a HTML document and have it make the text (or background or whatever) the color I chose in the Visual Basics program.
    Last edited by Divran; Mar 10th, 2009 at 09:15 AM.

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