User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16

Thread: How can I convert a hex rgb color value to non hex

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    St. Ave France
    Posts
    1,166
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    How can I convert a hex rgb color value to non hex

    I want people to be able to enter a hex color value (like from Photoshop)and for this color value to be shown in the color selector dialogue.

    such as : someone enters FFFFFF into the masked edit object, presses enter and suddenly the selected color in the color selector is white.

    any ideas?

    thanks

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,367
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I convert a hex rgb color value to non hex

    To get a hex value from a value, use:
    Hexvalue = Hex$(Val(<YourValue>))

    To convert a Hex value to a normal value, simply use this expression:

    Value = Val(<YourHexvalue>)

    For example will Val("0x64") produce 100


  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I convert a hex rgb color value to non hex

    Actually: Val("0x"+text) should do the trick. At least to give you a full RGB number. Then use GetRed(), GetGreen(), GetBlue() to get the three separate colours from it.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    St. Ave France
    Posts
    1,166
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I convert a hex rgb color value to non hex

    Hmm.. I tried:

    set selected color of color selector
    Val("0x"+getData$( "masked edit" ))

    and it isn't giving me correct colors.. What am I doing wrong?

  5. #5
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I convert a hex rgb color value to non hex

    Quote Originally Posted by HolyMonkey
    Hmm.. I tried:

    set selected color of color selector
    Val("0x"+getData$( "masked edit" ))

    and it isn't giving me correct colors.. What am I doing wrong?
    Quote Originally Posted by Dynasoft
    Then use GetRed(), GetGreen(), GetBlue() to get the three separate colours from it.



    Or, you can use Mid$() to get each part of the hex number and val them individually. I'll let someone else example that one.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    St. Ave France
    Posts
    1,166
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I convert a hex rgb color value to non hex

    I'll report back if I figure this out, but so fat nothing I try reproduces the corect color.

    There wouldnt happen to be an extension that converts hex color values to this sort of RGB value that the color-selector wants (and back) is there?

  7. #7
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I convert a hex rgb color value to non hex

    Val("0x" + Mid$(getData$( "masked edit" ), 0, 2))
    Val("0x" + Mid$(getData$( "masked edit" ), 2, 2))
    Val("0x" + Mid$(getData$( "masked edit" ), 4, 2))

    GetRGB(Val("0x" + Mid$(getData$( "masked edit" ), 0, 2)), Val("0x" + Mid$(getData$( "masked edit" ), 2, 2)), Val("0x" + Mid$(getData$( "masked edit" ), 4, 2)))

    (MMF2 needs macros badly)

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    St. Ave France
    Posts
    1,166
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I convert a hex rgb color value to non hex

    but I dont want the red, green, and blue seperately, I want the RGB value (one number)

    Sorry if I'm being stupid here, but the color selector wants one number, not the three seperate values... what is the full formula I use to take FFFFFF and convert it to the RGB value that the color selector object needs so that it displays white?

  9. #9
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I convert a hex rgb color value to non hex

    There's a formula in bold at the bottom of my post.

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    St. Ave France
    Posts
    1,166
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How can I convert a hex rgb color value to non hex

    I apreciate it very much Jamie (and everyone else) BUT even this formula is not giving me the correct color... I need to check the other related code and see if I'm introducing another bug elsewhere that is corrupting the numbers....

    Has anyone tried or is anyone willing to try making an actual example to make sure the formula effects the color selector as intended?


Page 1 of 2 1 2 LastLast

Similar Threads

  1. [BUG 256.34] Replace color doesn't always work in standard 256 color mode
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 26th October 2014, 10:21 AM
  2. Transparent color not applied when 16bit color mode
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 25th September 2012, 06:11 AM
  3. Transparent color is visible in 16bit color
    By ASD in forum SWF/Flash Export Module Version 2.0
    Replies: 1
    Last Post: 1st September 2010, 04:51 PM
  4. Possible to convert to mac
    By MikeB in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 28th October 2008, 02:05 AM
  5. Picture editor: color problems in 256 color mode.
    By contra in forum File Archive
    Replies: 5
    Last Post: 13th December 2006, 10:58 PM

Posting Permissions

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