User Tag List

Results 1 to 9 of 9

Thread: number stytem for color selector?

  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)

    number stytem for color selector?

    Hi everyone.. I'm making an editor where the user can set the color of an object on screen using both the color selector dialogue AND a text edit box.

    I'd love for the user to be able to see the colro as prepresented by the hex numeric system that is used in pretty much every graphics program like Photoshop and Promotion.

    Is there a way I can translate the number that can be retreived from the color selector dialogue into the hex format that is much more useful and familiar to artists?

    thanks

  2. #2
    Clicker Fusion 2.5iOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)

    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: number stytem for color selector?

    Right$(Hex$(256+GetRed(getColor( "Color Selector" ))), 2)+Right$(Hex$(256+GetGreen(getColor( "Color Selector" ))), 2)+Right$(Hex$(256+GetBlue(getColor( "Color Selector" ))), 2)

    That should work. The reason I'm adding 256 to each value and fetching the two rightmost characters is to be sure to get 0A instead of just A, 04 instead of 4 etc when handling values below 10h. Might be an easier way but heck if I know. :P

  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: number stytem for color selector?

    Pretty sure Hex$ normally prefixes the number too, and this handily avoids that.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: number stytem for color selector?

    Dynasoft, no. The output is formatted as 0xABC, e.g. 0x123, 0xA...

  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: number stytem for color selector?

    By "Hex$ prefixes the number" I meant "it adds '0x' to the beginning".

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: number stytem for color selector?

    Ah, sorry. I get your point now.
    I kind of misunderstood "and this handily avoids that" as if crusher's solution would totally ignore the fact that MMF already adds a leading zero on its own. :blush:

  7. #7
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: number stytem for color selector?

    I have added an example that may help.

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=176300&#Post176 300

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  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: number stytem for color selector?

    Thank you all so much for the help and clarification!




    One last question. How do I set a masked edit object to allow for hex numbers?!?


    (Edit) Never mind... i just had a bug breaking my hex stuff.
    the solution was simply:
    [a-zA-Z0-9]

  9. #9
    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: number stytem for color selector?

    Actually I do have one last question!

    How can I reconvert the Hex rgb value thats now in the edit box so I can put this new color in the color selector?

    In oither words, how can I do the reverse of the first question?

Similar Threads

  1. color selector?
    By Leo in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th November 2010, 12:37 AM
  2. Color Selector and retreiving RGB
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 13th December 2007, 01:03 PM
  3. Color Selector, how to set selected color
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 11th December 2007, 11:47 AM
  4. About the Color Selector Object
    By X_Sheep in forum Extension Development
    Replies: 3
    Last Post: 3rd September 2007, 11:20 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
  •