Results 1 to 14 of 14

Thread: Introduction/Explanation of RGB color + AutoColoring with RGB!

  1. #1
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default Introduction/Explanation of RGB color + AutoColoring with RGB!

    Welcome to the land of RGB!

    Since almost every one knows what RGB is, I really shouldn't but (RGB will be a little confusing if you just came from a Color Theory class):

    Quote Originally Posted by Wikiworld
    An RGB color space is any additive color space based on the RGB color model.
    RGB-Cube
    RGB-Cube

    RGB is shorthand for Red, Green, Blue.

    RGB is a convenient color model for computer graphics because the human visual system works in a way that is similar—though not quite identical—to an RGB color space. The most commonly used RGB color spaces are sRGB and Adobe RGB (which has a significantly larger gamut). Adobe has recently developed another color space called Adobe Wide Gamut RGB, which is even larger, in detriment to gamut density.

    As of 2007, sRGB is by far the most commonly used RGB color space, particularly in consumer grade digital cameras, because it is considered adequate for most consumer applications, and its design simplifies previewing on the typical computer display. Adobe RGB is being built into more medium-grade digital cameras, and is favored by many professional graphic artists for its larger gamut.
    of course, it could be explained like this...

    Quote Originally Posted by r0b0t1
    RGB is the most popular way to display and/or reference colors. The consonants R, G, and B are representations of the intensity of the Red, Green, and Blue in that color.
    What I've seen people trip up on, is that using RGB as a color spectrum is different from the real world RYB (Red yellow blue), as wavelengths of light mix differently from pigments... So don't think Red and blue make purple, they make a dark pink! (Lol? Who cares...).

    So really, the only thing left would be to give you a picture...




    Still don't get it? Hit me up on MSN (r0b0t1@hotmail.com) or PM me.



    Now, most of you come here for autocoloring, yes? No interest in discussing how RGB works? Fine... But you first need to understand the principal used in autocoloring.

    The Principal: When you get a color from Runescape, that color can be split up into the R, G, and B values of said color. How does this help? Well, we can check if we have the right color through trial and error, so creating an autocoloring procedure can be tiresome (I have yet to experiment with a custom version....), so the Devs' have made us some autocoloring procedures for us! Now, if you want to learn anything about making your own, you might as well listen to me.

    Here are the steps (I will break down FindWaterColor).

    1). First, know what you want to color.... (easiest on minimap)
    2). Second, you must have a color similar to the one you want to auto color.
    3). Now, we start to have fun. We must try to find that color and start comparing it.
    4). *OPTINAL* if it is a color from the minimap, check if it is there.

    EDIT: What Tarajunky told me he did was pick twenty colors and turn them to RGB, and pick one of those colors, and get the differenced bewtween those, and the "special" color you picked. Feel free to PM me (or post), as this may be confusing.

    So, the breakdown...

    SCAR Code:
    function FindWaterColor: Integer;
    You declare the function... Of course.

    SCAR Code:
    var
      GC, a, l, TestColor, Red, Green, Blue : integer;
    var
      P:array of Tpoint;
    And then the variables...

    SCAR Code:
    begin
      GC := 12095356;
      Flag;
    Now, we start the function, set the color close to the one we want (The water color in this case), and wait until we stop moving (always a good idea).

    SCAR Code:
    FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 50);
      l:=GetArrayLength(P);
    Now, we search for the color like ours, with a high tolerance, and set a variable to be the length of the TpointArray P.

    SCAR Code:
    for a:= 0 to l-1 do
      begin
        if rs_OnMinimap(P[a].x,P[a].y) then
        begin
    Then we start a for loop, and for every iteration, we check if the point where one of the colors was found is on the minimap.

    SCAR Code:
    TestColor := GetColor(P[a].x,P[a].y);
          if SimilarColors(TestColor,GC,50) then
          begin
    Now we get the color at the point on the MM where one of the colors was found... And then we check if that color is at least withing 50 tolerance of our main one.

    SCAR Code:
    red := (TestColor mod 256);
            green := ((TestColor / 256) mod 256);
            blue := ((TestColor / 256) / 256);
    This is simply what ColorToRGB does.

    SCAR Code:
    if Green - Red <= 22 then if Green - Red >= 18 then
              if Blue - Red >= 55 then if Blue - Red <= 72 then
                if Blue - Green >= 35 then if Blue - Green <= 52 then
                  if GetColor(P[a].x + 2, P[a].y + 2) = TestColor then
                    if GetColor(P[a].x + 1, P[a].y + 1) = TestColor then
                      if GetColor(P[a].x, P[a].y + 2) = TestColor then
                        if GetColor(P[a].x + 2, P[a].y) = TestColor then
                          if GetColor(P[a].x, P[a].y + 1) = TestColor then
                            if GetColor(P[a].x + 1, P[a].y) = TestColor then
                              if GetColor(P[a].x + 2, P[a].y + 1) = TestColor then
                                if GetColor(P[a].x + 1, P[a].y + 2) = TestColor then
                                begin
    This is the hardest part, the comparison. This just makes sure that the color it found is fairly close to the original one, by lots of if statements... I guess I'll go ask Tarajunky how he got those numbers...

    SCAR Code:
    Result := TestColor;
                                  WaterColor := TestColor;
                                  WriteLn('WaterColor = ' + IntToStr(TestColor));
                                  Exit;
                                end;
          end;
        end;
      end;
    Now, should it pass all of those tests... Then it makes the global Var WaterColor equal to whatever it found, prints the watercolor, and returns the water color... Yay.

    SCAR Code:
    WriteLn('Could not find Water Color!');
      Result := 0;
    end;
    Lest misfortune befall our mighty script, it will tell you so.


    Another possible use for this would be to find colors, as you could and can change each different part of the color singly. Or, you could make an object finding, npc finding, and other finding thing with it. (Some things should be saved for HSL, of course)

    Now... I trust you all will start thinking... Or else!
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

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

    Default

    nice one i really understand 75% of it gratz
    ~Hermen

  3. #3
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Confusion , confusion

    Where did you get the '1' variable from, Ill learn TPoints then come back

  4. #4
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    I said if you didn't get part of the tutorial, to come see me.


    Well, TPoints are just ... points. And are used as.

    SCAR Code:
    Var TPoint1: TPoint;

    TPoint1.x:= SomeValue;
    TPoint1.y:= SomeValue;

    Tada?
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  5. #5
    Join Date
    Nov 2006
    Location
    In an Amish Paradise
    Posts
    729
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Color Master!
    Three Tutorials all about color in under 24 hours! I would say the above is true!!

    ~Stupedspam

  6. #6
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Lol, yep, I'm working for it... I want to annoy Fakawi enough to get him to give me that title. . (JK).


    Well, I want to accomplish something. Color seemed the easiest way.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  7. #7
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Now, we start the function, set the color close to the one we want (The water color in this case), and wait until we stop moving (always a good idea).
    I don't understand what you meant by this. Does it mean choose a colour that's close to the one we want?
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  8. #8
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Yes. I forgot to edit my post.

    To answer you're question, I mean the Variable called "GC" in the function. Sorry .
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  9. #9
    Join Date
    Mar 2007
    Location
    Ohio
    Posts
    138
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    sorry for the bump, but i have a question about how to get these numbers when using RGB
    SCAR Code:
    if Green - Red <= {22} then if Green - Red >= {18} then
              if Blue - Red >= {55} then if Blue - Red <= {72} then
                if Blue - Green >= {35} then if Blue - Green <= {52} then
    { The commented values are the ones i dont know how to get}

    Again sorry for the bump, i know its not a huge jump but yea. thanks for all your help

    Cameron

  10. #10
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    If you pick the watercolor run it through ColorToRGB() you will have 3 vars, just print them out using writeln.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  11. #11
    Join Date
    Mar 2007
    Location
    Ohio
    Posts
    138
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    If you pick the watercolor run it through ColorToRGB() you will have 3 vars, just print them out using writeln.
    So once i do that should i pick another color, thats still the water color but when it has changed during a world switch or something? and subtracting the values of RGB and see if i get a kinda consistent result? thanks

  12. #12
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by stampede10343 View Post
    So once i do that should i pick another color, thats still the water color but when it has changed during a world switch or something? and subtracting the values of RGB and see if i get a kinda consistent result? thanks
    Thats right.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  13. #13
    Join Date
    Mar 2007
    Location
    Ohio
    Posts
    138
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  14. #14
    Join Date
    Jun 2007
    Posts
    1,312
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I guess I'll go ask Tarajunky how he got those numbers...
    ...? Why would you put that in if you don't plan on updating with what Tara said?
    Active only during the Summer...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. explanation plz
    By hackncrack1 in forum OSR Help
    Replies: 2
    Last Post: 11-23-2008, 03:23 PM
  2. Explanation?
    By HyperSecret in forum News and General
    Replies: 0
    Last Post: 01-02-2008, 10:47 PM
  3. Introduction/Explanation of XYZ color. ( > 500KB)
    By R0b0t1 in forum OSR Advanced Scripting Tutorials
    Replies: 15
    Last Post: 09-13-2007, 10:23 PM
  4. Introduction/Explanation of HSL color/Edge finding starter.
    By R0b0t1 in forum OSR Advanced Scripting Tutorials
    Replies: 6
    Last Post: 09-13-2007, 01:04 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
  •