Results 1 to 8 of 8

Thread: CTS3 Help

  1. #1
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default CTS3 Help

    Simba Code:
    Program CTS3;
     {.include SRL\SRL.scar}
     {.Include SRL\SRL\Misc\Debug.SCAR}
        Procedure ReturnValues(colors: TIntegerArray; var HueMods, SatMods: Extended; var color, Tolerance: Integer);
          Var
            h, s, t: Extended;
            I,II : integer;
            HSLColor : Array[1..3] of Extended;
            HSL : Array[0..1] of Array[1..3] of Extended;
          begin;
            For I:= 1 to 3 do
            begin;
              HSL[0][i] := 255;
            end;

            For I:= 0 to High(Colors) do
            begin;
              ColortoHSL(Colors[i],HSLColor[1],HSLColor[2],HSLColor[3]);
              For II:= 1 to 3 do
              begin;
                HSL[0][II] := MinE(HSLColor[II],HSL[0][II]);
                HSL[1][II] := MaxE(HSLColor[II],HSL[1][II]);
              end;
            end;

            H := (HSL[1][1] - HSL[0][1]);
            S := (HSL[1][2] - HSL[0][2]);
            T := (HSL[1][3] - HSL[0][3]);

            try
              HueMods := (H/T);
              SatMods := (S/T);
              Tolerance := Round(t);
            except
              HueMods := 0;
              SatMods := 0;
              Tolerance := Round(0.0);
            end;

            Color := HSLToColor((HSL[1][1] + HSL[0][1]) div 2,(HSL[1][2] + HSL[0][2]) div 2,(HSL[1][3] + HSL[0][3]) div 2);
          end;


    Procedure DoitBro;
      var
        HMod, SMod:Extended;
        Col, Tol: Integer;
        TPA:TPointArray;
    Begin
        ReturnValues([2322763, 2455375, 2720856, 2388812, 2521938], Hmod, Smod, Col, Tol);

        ColorToleranceSpeed(3);     //CTS3
        SetColorSpeed2Modifiers(Hmod, SMod);
        FindColorsSpiralTolerance(MSCX, MSCY, TPA, Col, MSX1, MSY1, MSX2, MSY2, Tol);
        DebugTPA(TPA,'');



    End;
             


    Begin
      DoitBro;
    End.

    Is that all good?
    Make sense?
    Should work?

  2. #2
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    CTS3 != Hue Saturation Luminence

    It's CIELab.

  3. #3
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    idk mayne, that's just some code Flight gave me :/
    I wish ACA would update and add CTS3 to it, so easy!
    How do I get info for CTS3?

  4. #4
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Flight -.-

    When a new simba get released we will actually be able to make scripts like this.

  5. #5
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    HEY!
    Flight is really cool and my friend, don't be a bully!

  6. #6
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    Flight -.-
    And what's that supposed to mean?

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  7. #7
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Ahh you couldn't see my facial expression. It was like: "Oh silly Flight"

  8. #8
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    https://github.com/MerlijnWajer/Simb...d1312c32ddd9b4
    You could also build the most recent simba(after this commit) and get a headstart.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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