Page 3 of 3 FirstFirst 123
Results 51 to 64 of 64

Thread: How to design Autocolor Functions (Along with examples and tools!)

  1. #51
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    very NICE! rep++
    i still don't understand why you subtract red-blue or w/e??
    but its still nice

  2. #52
    Join Date
    Jan 2008
    Location
    Frankfurt, Germany
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright, well, here I am again and back to answering those questions (sorry, I know this stuff is sort old by now, but heck, it might still help someone ^^).

    The whole system is elimination. Basically, it searches for something similar to the color given. Now, let's say you want to find the road color. Now, the building color, the road color, and the castle color might all fit into that wide tolerance. Then it does the substraction in order to widen the gap of difference between those similar colors. For example, the road and the building color might look very similar, so that even the RGB values are quite similar. But, after the substraction of certain values (which you can easily find out by testing), the difference is big enough to sort out and eliminate very similar but wrong colors (e.g. a rock, road, building colors).

    This might sound a bit confusing, especially if you don't have a very good idea of what RGB actually is and what range of values affects a color in a certain way. If that's the case, I'd advise you to open Paint, or any other graphical program and find some way to "create" a color. There you should find an RGB option with sliders. Have fun playing around.^^
    There is nothing right in my left brain and there is nothing left in my right brain.

  3. #53
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by Pure1993 View Post
    Alright, well, here I am again and back to answering those questions (sorry, I know this stuff is sort old by now, but heck, it might still help someone ^^).

    The whole system is elimination. Basically, it searches for something similar to the color given. Now, let's say you want to find the road color. Now, the building color, the road color, and the castle color might all fit into that wide tolerance. Then it does the substraction in order to widen the gap of difference between those similar colors. For example, the road and the building color might look very similar, so that even the RGB values are quite similar. But, after the substraction of certain values (which you can easily find out by testing), the difference is big enough to sort out and eliminate very similar but wrong colors (e.g. a rock, road, building colors).

    This might sound a bit confusing, especially if you don't have a very good idea of what RGB actually is and what range of values affects a color in a certain way. If that's the case, I'd advise you to open Paint, or any other graphical program and find some way to "create" a color. There you should find an RGB option with sliders. Have fun playing around.^^
    nieslie auto color ftw? thats what ill do

  4. #54
    Join Date
    Feb 2009
    Location
    UK
    Posts
    89
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Finally I understand autocoloring, all thanks to you and your great tutorial.

    Thank you very much!

  5. #55
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Epic!
    You could go a little bit deeper into the why do you divide and multiply those RGB etc.
    ~Hermen

  6. #56
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    How do I convert R G and B into scar color? (A)

  7. #57
    Join Date
    Jan 2008
    Location
    Frankfurt, Germany
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol, I haven't checked this tutorial in ages... didn't think anyone is still visiting it.

    @Zyt3x: Did you try to do the following: Open Scar.exe >> Help >> Help F1 >> [ctrl + f] {Type:} RGB >> {Click on:} "Search" ?
    There you will find the following option:

    SCAR Code:
    function RGBtoColor(R, G, B: Integer): TColor;
    Converts RGB values to a color.


    But I am interested in the code of that function... so if anyone knows it, feel free to post here...

    @Hermpie: Where am I dividing/multiplying? I haven't multiplied a single time in the entire tutorial, but if you are reffering to this:
    SCAR Code:
    program ColorsToRGBTool;
    {.include srl/srl.scar}

    const
      TheColor = 16777215; //white background of the Scar program, substitute it with any color you want.
     
    var
      Red, Blue, Green: Integer;
     
    begin
      Red := (TheColor mod 256);
      Green := ((TheColor / 256) mod 256);
      Blue := ((TheColor / 256) / 256);
      Writeln('----------------------------------------------');
      Writeln('The color '+IntToStr(TheColor));
      Writeln('Was turned into the following values: ');
      Writeln('Red = '+IntToStr(Red));
      Writeln('Green = '+IntToStr(Green));
      writeln('Blue = '+IntToStr(Blue));
      Writeln('----------------------------------------------');
    end.
    Then the reason is simple: This is the exact same thing as "ColorToRGB", which is a function included in the "Help" section of Scar, it is the first function in the "Color conversion functions:" section.

    Well, since this tutorial is still being used, I'll update the picture links which have appearently become obsolete.
    There is nothing right in my left brain and there is nothing left in my right brain.

  8. #58
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, but why do you divide? I see it as a trick I know how it works, but what's the reason.
    You still got msn?
    ~Hermen

  9. #59
    Join Date
    Jan 2008
    Location
    Frankfurt, Germany
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah, I still have MSN, but quite honestly, I forgot my password
    I'll create a new account tomorrow

    Anyway, I'll try to explain it one last time, just for you
    When you are picking a color with scar, it converts the color into an integer. You might be aware of that. Now, if you have read the tutorial, you know, that every color is made up of red, green, and blue colors.
    Now, the integers, which Scar returns when selecting a color, aren't random, neither has every existing color been specificly named. It goes through a little process of identification, and then combines the values of the certain characteristics (including HSL and RGB) to make a single number out of it. The ColorToRGB simply reverses that process.

    I hope this is somewhat understandable, and that it is correct, because I have not done a single second of research on what I have just written, so it is only my best guess.
    There is nothing right in my left brain and there is nothing left in my right brain.

  10. #60
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by Pure1993 View Post
    Lol, I haven't checked this tutorial in ages... didn't think anyone is still visiting it.

    @Zyt3x: Did you try to do the following: Open Scar.exe >> Help >> Help F1 >> [ctrl + f] {Type:} RGB >> {Click on:} "Search" ?
    woah.. lol
    Thank you :P

    EDIT: Omfg it works!
    EDIT2:
    Quote Originally Posted by Hermpie View Post
    Yes, but why do you divide? I see it as a trick I know how it works, but what's the reason.
    You still got msn?
    He divides to get the correct answer
    Last edited by Zyt3x; 04-18-2009 at 05:13 AM.

  11. #61
    Join Date
    Jan 2008
    Location
    Frankfurt, Germany
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No problem mate
    There is nothing right in my left brain and there is nothing left in my right brain.

  12. #62
    Join Date
    Jan 2008
    Location
    Frankfurt, Germany
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    NEW UPDATE 3: Introduction on how to use auto coloring to create your very own Minimap Door finding procedure!
    You will find this on the second reply to this thread, because my first post had too many pictures for this new forum board, so I can't edit it without removing the pictures, which I don't feel like doing.

    PS: Sorry for the double Post
    There is nothing right in my left brain and there is nothing left in my right brain.

  13. #63
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    thx for finally adding the HSL thing. i checked up on this about 2-3weeks back and it didnt have it yet. but thx. and dang... i wish i know about colortorgb/colortohsl a long time ago.

  14. #64
    Join Date
    Jan 2008
    Location
    Frankfurt, Germany
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    erm, tbh, the HSL thing has been there for ages now, the new thing I added has been the different ways to apply the principle of autocoloring. You'll find it on the second reply, because there wasn't enough space on the main post.
    There is nothing right in my left brain and there is nothing left in my right brain.

Page 3 of 3 FirstFirst 123

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. 2 "new" AutoColor Functions
    By Pure1993 in forum Research & Development Lounge
    Replies: 12
    Last Post: 03-01-2008, 05:21 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
  •