Results 1 to 8 of 8

Thread: Question about Color Code

  1. #1
    Variable Bitrate GF-ler's Avatar
    Join Date
    Aug 2005
    Location
    germany
    Posts
    349

    Question about Color Code

    first what i want to do:

    in my last riderunner skin i have the option to change the fontcolor.
    its programmed in flash and shows the the value of RED GREEN and BLUE.
    also it shows the value of all 3 colors in HEX.

    my question now is, how i get the informations of RED GREEN and BLUE into riderunner.
    riderunner works in two ways for fixing the color value.
    first you write a number between 0 to 255 in the field for RED or GREEN or BLUE
    or
    you shift a value with the DEFIND in a ?? cell ?? like #Col1R#...#Col1B#
    i make question marks while dont know for what #Col1R# stands. is it a variable ? think not while skintool say NO VARIABLE or is it a cell.

    AND

    how can i push an information from a flash variable into this cell ?

    OR

    is there an undocumented order like $Col1R$ that means take the information of variable $Col1R$ ?

    i take a look in the DFX3 skin, it works only by push and pop with pressing a button.
    and it works with an autoit script which only opend by pulse of the button.

    this way i can use for changing the whole skin with new font color, but not for the preview.(left side screen)

    Name:  font_color_selector.png
Views: 337
Size:  274.0 KB

  2. #2
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,817
    #Col1R# -> This is a skin constant, works like this:

    /DEFINE COL1R 255
    /DEFINE COL1G 255
    /DEFINE COL1B 255

    Lxx,xxx,...,#COL1R#,#COL1G#,#COL1B#...

    Once the /DEFINE is set, anything that comes after it will be replaced with the defined value (in this case #COL1R# gets replaced with 255 and so on).

    You can place your /DEFINE lines in a separate file and then include it in your .skin files using INC,defines.txt etc. If you do this and setup all your labels on your .skin files with the #COL1R# values, you can basically edit the defines.txt file and it will make it effective to all .skin files (once you reload the skin/screens).

    I believe the DFX skin launches the auto-it script to make the defines file, so that after you pick a color it saves the defines.txt file (or whatever is named there) and reloads the skin to apply the new colors.

    You can probably make the txt file directly with RR commands if you have the values already in RR (i.e. in variables or in sliders/labels/etc) -- using WRITETOFILE/ADTOFILE. If you're picking the color in flash then you either want to save the file directly from it or set variables in RR to be saved to the txt file -- or even make an autoit to do that for you. The truth is that there are so many different ways of doing it that it is hard to say which way is easier/best for your skin.

    Let me know if you need more details.
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

  3. #3
    Variable Bitrate GF-ler's Avatar
    Join Date
    Aug 2005
    Location
    germany
    Posts
    349
    Quote Originally Posted by guino View Post
    #Col1R# -> This is a skin constant, works like this:

    /DEFINE COL1R 255
    /DEFINE COL1G 255
    /DEFINE COL1B 255

    Lxx,xxx,...,#COL1R#,#COL1G#,#COL1B#...

    Once the /DEFINE is set, anything that comes after it will be replaced with the defined value (in this case #COL1R# gets replaced with 255 and so on).

    You can place your /DEFINE lines in a separate file and then include it in your .skin files using INC,defines.txt etc. If you do this and setup all your labels on your .skin files with the #COL1R# values, you can basically edit the defines.txt file and it will make it effective to all .skin files (once you reload the skin/screens).

    I believe the DFX skin launches the auto-it script to make the defines file, so that after you pick a color it saves the defines.txt file (or whatever is named there) and reloads the skin to apply the new colors.

    You can probably make the txt file directly with RR commands if you have the values already in RR (i.e. in variables or in sliders/labels/etc) -- using WRITETOFILE/ADTOFILE. If you're picking the color in flash then you either want to save the file directly from it or set variables in RR to be saved to the txt file -- or even make an autoit to do that for you. The truth is that there are so many different ways of doing it that it is hard to say which way is easier/best for your skin.

    Let me know if you need more details.
    hi guino,
    thanks for your quick answer

    in part of the DEFIND order i know how it works, most skins are working with the INC,colors.txt where for most things the color could be changed.

    what i thougt was, if the color code could be in a value between 0 to 255 OR a skin constant, it could be also ba a variable.
    if this is not possible, perhaps it gives an easy way to transfer a variable into a skin constant.
    now i learned it only goes through the way of separate file and an autoit script.

    what i now try to program is an autoit script that always works if the font color.skin is opend. inside i actuate the preview color "Constant" and if the select would be pressed i load the active color code and push it in a second "constant". with this constant the complete skin would be refreshed.

    for it i must ask my son, the best time of coding is behind me. to old for new things.
    without my dog i lost the way home.

    regards

  4. #4
    Super Moderator
    Auto Apps:loading...
    JohnWPB's Avatar
    Join Date
    Sep 2005
    Location
    West Palm Beach, Florida
    Posts
    4,723
    Blog Entries
    1
    Guten Tag!

    I do not know if this will help or not, but it is the AutoIt code that I was using in the lastDFX skin for creating the include file. (This is now handled in DFX5 with the DFX5.dll) This code also converts the color passed to it from HEX to RGB.

    I put in a few msg boxes that you can un-comment to see what it happening, as well as some comments to show what sections do what.....

    PHP Code:

    #include <File.au3>
    dim $RRFile
    dim $RGBcolor
    dim $HEXcolor

    $RRFile 
    $cmdlineraw
    ;MsgBox(4096""$RRFile)

    ;
    Gets the RGB COlor passed fom RR
    $RGBcolor 
    $cmdline[1]

    ;
    Convert the RGB color to the 3 colors that RR Requires
    $R 
    BitANDBitShift($RGBcolor16), 0xff)
    $G BitANDBitShift($RGBcolor8), 0xff)
    $B BitAND($RGBcolor0xff)

    ;
    MsgBox(4096""$R "," $G "," $B)

    ;
    Write These values to the include file
    _FileWriteToLine
    ("..\DFX_Font_Color.txt"1"/DEFINE DFX1R " $R1)
    _FileWriteToLine("..\DFX_Font_Color.txt"2"/DEFINE DFX1G " $G1)
    _FileWriteToLine("..\DFX_Font_Color.txt"3"/DEFINE DFX1B " $B1
    You will need to get your Hex color into a variable, say you call the variable $HexColorCode$.

    To pass the variable from RR to the script, use the following command:

    PHP Code:
    RunQ;$skinpath$scripts\SaveIncludeFile.exe|$HexColorCode
    If you colors are already in RGB, then you will not need convert, and will have to alter the script a bit.
    Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

    My Fiero Build Thread

  5. #5
    Variable Bitrate GF-ler's Avatar
    Join Date
    Aug 2005
    Location
    germany
    Posts
    349
    hi john,

    yeah it helps a lot.
    i decompile your autoit.exe....and its horrible to know whats important and whats only for the mask autoit knows to compile from .au3 to .exe.

    if i had new questions, i will ask.

    regards

  6. #6
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,817
    In order to keep the skin processing faster, we avoid re-defining the skin objects (i.e. label) without reloading the screen -- this is why a variable won't work in the label definition (other than in the code and format fields). Having said that, if all you want is to show some preview of the colors before choosing them we can make a command to change the color of a label without reloading the screen, but I'd still recommend reloadscreen when possible.

    Let me know if a command to change the label color would be helpful, and I'll add it.
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

  7. #7
    Variable Bitrate GF-ler's Avatar
    Join Date
    Aug 2005
    Location
    germany
    Posts
    349
    Quote Originally Posted by guino View Post
    In order to keep the skin processing faster, we avoid re-defining the skin objects (i.e. label) without reloading the screen -- this is why a variable won't work in the label definition (other than in the code and format fields). Having said that, if all you want is to show some preview of the colors before choosing them we can make a command to change the color of a label without reloading the screen, but I'd still recommend reloadscreen when possible.

    Let me know if a command to change the label color would be helpful, and I'll add it.
    hi guino,

    first i didnt undestand what you mean. i always thought the structure of the rr code is like its written in the .skin file. that it always actuate in every cycle the INC, entries.

    now i test it, and f... iam from the other side of coding.
    it only actuate the constants once.
    so it would be very helpfull if there is a faster way without a "reloadscreen"

    the "reloadscreen" i will start if the fixed color should read in in the complete skin.
    its the way DFX3-5 does and no problem.

    regards

  8. #8
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,817
    INC files are always parsed at the time of loading the screen. Still, RR caches the skin/screen so the .skin file is only parsed once (thus the need for reloadscreen). Parsing the .skin file every time you show a screen would significantly reduce performance.
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

Similar Threads

  1. heavy-duty OBD standards support question
    By Michael2006 in forum Engine Management, OBD-II, Engine Diagnostics, etc.
    Replies: 0
    Last Post: 01-07-2007, 05:13 AM
  2. Replies: 2
    Last Post: 05-02-2006, 06:15 PM
  3. Forum Etiquette
    By Enforcer in forum Newbie
    Replies: 5
    Last Post: 01-09-2006, 06:58 PM
  4. Paint And Polish Question
    By gboy in forum Fabrication
    Replies: 8
    Last Post: 08-13-2005, 08:22 PM
  5. FM Card Question....
    By Superbike1k in forum Car Audio
    Replies: 1
    Last Post: 05-16-2005, 10:03 AM

Bookmarks

Posting Permissions

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