User Tag List

Results 1 to 3 of 3

Thread: RTF background color by RGB seperated values.

  1. #1
    No Products Registered

    Join Date
    Jul 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question RTF background color by RGB seperated values.

    I'm making a simple RTF editor, but my background color feature doesn't work as expected. I've had it working already, but using a really clunky text-based system that parses RGB values by pulling them as the last 11 characters in a preset string, but now I'm thinking I'd like to create an actual color selector.

    Problem is, the RTF object only accepts color values in two formats. "255, 255, 255" as a string which determines Red, Green, and Blue values respectively and some weird "BLUE*00000 + GREEN*00000 + RED*00000" integer format that I don't quite understand.

    The color picker's I've used don't allow for separate RGB values, and I can't really determine any standard RGB value from them. Usually, they pass some number like 6736193. I could understand that if G=061 and B=093, but Red can't be more than 255 in a standard RGB system.

    I threw out the idea of using the color-picker system and built a mini subapp with three numerical slider controls. Standard values are all 100; max to 255. Problem is, I can't find any kind of object that will handle each of the separate RGB values to display the user-selected color (there's no items that can preview even if I find some way to combine the three numerical slider values).

    So, yeah... I can allow the user to change the separate color values and apply them to the RTF document background, but without any user preview. I can get a preview using the color selector object, but then I can't apply it to the RTF document background.

  2. #2
    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,739
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    That number like 6736193 is what the expression that says "BLUE*00000 + GREEN*00000 + RED*00000" wants. Basically multiplying the numbers with certain values (to be exact: 1 for red, 256 for green, 65536 for blue) allows you to store the colors in a single value because each color component will have its own byte in the integer. There's an expression which does the math for you btw, GetRGB(r,g,b).

  3. #3
    No Products Registered

    Join Date
    Jul 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wicked awesome. Many thanks, man.

Similar Threads

  1. Frame background color
    By qenio in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 19th August 2013, 07:47 PM
  2. how to read individual values seperated by comma?
    By BrashMonkey in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 28th September 2009, 03:31 PM
  3. Iconview background color
    By gamefreak202 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 4th July 2009, 04:37 PM
  4. transparent background color
    By FormerTGFGuy in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 10th November 2007, 09:01 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
  •