Results 1 to 16 of 16

Thread: HTML Color

  1. #1

    Thread Starter
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871

    HTML Color

    I found this code on the forum and it's working great, but I can't really understand its functionality. This code converts Color values as used by VB to HTML Colors (certain kind of Hexadecimal colors). Does somebody have a code that does the opposite; convert HTML Colors to VB understandable code?

    Thx

    [edit]o ****, posted it in Chit Chat... can a mod kick this to the VB General Questions?[/edit]

    VB Code:
    1. Public Function ColorHTML(Number As Long) As String
    2. Dim MyString As String, MyNum As Long, MyCalc As Long, MyRemainder As Long, X As Integer
    3. MyRemainder = Number
    4.     MyString = ""
    5.     For X = 2 To 0 Step -1
    6.         MyCalc = MyRemainder \ 256 ^ X
    7.         MyString = Format$(Hex(MyCalc), "00") & MyString
    8.         MyRemainder = MyRemainder - MyCalc * 256 ^ X
    9.     Next
    10.     txtColor.Text = MyString
    11. End Function

  2. #2
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    Typical, uneducated yank.


    Its colour! Not Color.

  3. #3

    Thread Starter
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871
    Hey, I'm not a yank! I'm Dutch and I know perfectly well the difference between British and American English. I've chosen the American word for colour because it's internationally accepted.

    Oh, and since you give yourself the privilege of guessing my form of education, I am absolutely not uneducated; I've just finished grammar school...

  4. #4
    Fanatic Member siyan's Avatar
    Join Date
    Jul 2001
    Location
    GOOOAAAAALLLLL!!!!!
    Posts
    869
    I think he was joking
    Unite, proletariat!

  5. #5
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    Originally posted by siyan
    I think he was joking
    Ssssh!!

  6. #6

    Thread Starter
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871

    Talking

    Now kick this thing to General VB Questions then...

  7. #7
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    Just repost it. Be easy. The service around here is horrible!



    See if that sends Jamie running?

  8. #8
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Originally posted by Pc_Madness
    Just repost it. Be easy. The service around here is horrible!



    See if that sends Jamie running?

    *BOF* broken nose


    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  9. #9
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    Originally posted by plenderj
    *BOF* broken nose


    lol.

    You always break people noses. When are you gunna break an arm or something?

  10. #10
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860
    Whatarecolors??Pleaseexplainthemtome.
    Don't pay attention to this signature, it's contradictory.

  11. #11
    Fanatic Member siyan's Avatar
    Join Date
    Jul 2001
    Location
    GOOOAAAAALLLLL!!!!!
    Posts
    869
    Originally posted by alkatran
    Whatarecolors??Pleaseexplainthemtome.
    I hope you used a script/proggie to do that.
    Unite, proletariat!

  12. #12
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    Lets hope so.

  13. #13
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    Originally posted by Pc_Madness
    Lets hope so.
    Ohhedid.VeryfewpeoplehaveTHATmuchtimeontheirhands.
    You just proved that sig advertisements work.

  14. #14
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    S o m e P eople can't be bothered to get a prog to do all of those silly colour things.

  15. #15
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    You just proved that sig advertisements work.

  16. #16
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860
    Isawapostsayingsomethingaboutdoingstuffinvbforum...(byanadministrator)
    dledtheprogramandfoundthisnicerainbowoption;)
    Don't pay attention to this signature, it's contradictory.

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