RTF background color by RGB seperated values.

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • 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.

  • 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).

    Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!