Results 1 to 4 of 4

Thread: Understanding CTS2

  1. #1
    Join Date
    Sep 2010
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Understanding CTS2

    Okay so I get the whole RGB things and Color Ranges, but can someone explain to me CTS2? Like how do I know what numbers I want to put into the Color2SpeedModifier etc. I read somewhere you can use the ACA tool (which I've downloaded) but I would also like to know how to do this without, just to build a better base for understanding.

    Please and Thank you

  2. #2
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I don't know if you can understand any of this yet, but it is the best explanation I know of.
    Simba Code:
    program New;
    //By Mastaraymond
    //0 = Min
    //1 = Max
    var
      I,II : integer;
      RGBColor : Array[1..3] of Integer;
      RGB : Array[0..1] of Array[1..3] of Integer;
      XYZColor, HSLColor : Array[1..3] of Extended;
      HSL,XYZ : Array[0..1] of Array[1..3] of Extended;
      Colors : TIntegerArray;
      Strings : Array[0..9] of String;
    Procedure Init;
    begin;
      Colors := [];
    end;
    begin
      Init;
      For I:= 1 to 3 do
      begin;
        Writeln('');
        RGB[0][i] := 255;
        HSL[0][i] := 255; //Max is 240?
        XYZ[0][i] := 255; //Max is ...?
      end;
      Strings[1] := 'R: ';
      Strings[0] := '   ';
      Strings[2] := 'G: ';
      Strings[3] := 'B: ';
      Strings[4] := 'H: ';
      Strings[5] := 'S: ';
      Strings[6] := 'L: ';
      Strings[7] := 'X: ';
      Strings[8] := 'Y: ';
      Strings[9] := 'Z: ';
      For I:= 0 to High(Colors) do
      begin;
        Strings[0] := Strings[0] + Padr('Color: '+inttostr(Colors[i]),16) +' | ';
        ColortoRGB(Colors[i],RGBColor[1],RGBColor[2],RGBColor[3]);
        ColortoHSL(Colors[i],HSLColor[1],HSLColor[2],HSLColor[3]);
        ColortoXYZ(Colors[i],XYZColor[1],XYZColor[2],XYZColor[3]);
        For II:= 1 to 3 do
        begin;
          RGB[0][II] := Min(RGBColor[II],RGB[0][II]);
          RGB[1][II] := Max(RGBColor[II],RGB[1][II]);
          HSL[0][II] := MinE(HSLColor[II],HSL[0][II]);
          HSL[1][II] := MaxE(HSLColor[II],HSL[1][II]);
          XYZ[0][II] := MinE(XYZColor[II],XYZ[0][II]);
          XYZ[1][II] := MaxE(XYZColor[II],XYZ[1][II]);
        end;
        For II := 1 to 3 do
          Strings[II] := Strings[II] +Padr(IntToStr  (RGBColor[II]),16) +' | ';
        For II := 4 to 6 do
          Strings[II] := Strings[II] +Padr(FloatToStr(HSLColor[II-3]),16) +' | ';
        For II := 7 to 9 do
          Strings[II] := Strings[II] +Padr(FloatToStr(XYZColor[II-6]),16) +' | ';
      end;
      For I:= 0 to 9 do
        Delete(Strings[i],Length(Strings[i])-2,3);
      For I:= 0 to 9 do
      begin;
        if (I = 1) or (I = 4)or (I = 7)  then Writeln('');
        Writeln(Strings[i]);
      end;
      Writeln('');
      Writeln('Highest RGB values = R: '+ Padr(FloatToStr(RGB[1][1]),3) +  ' | ' +'G: '+ Padr(FloatToStr(RGB[1][2]),3)  +  ' | ' +'B: '+ Padr(FloatToStr(RGB[1][3]),3) );
      Writeln('Lowest  RGB values = R: '+ Padr(FloatToStr(RGB[0][1]),3) +  ' | ' +'G: '+ Padr(FloatToStr(RGB[0][2]),3)  +  ' | ' +'B: '+ Padr(FloatToStr(RGB[0][3]),3) );
      Writeln('Differ  RGB values = R: '+ Padr(IntToStr(RGB[1][1] - RGB[0][1]),3) + ' | G: '+ Padr(inttostr(RGB[1][2] - RGB[0][2]) ,3) + ' | B: '+Padr(inttostr(RGB[1][3] - RGB[0][3]),3));
      Writeln('Middle  RGB values = R: '+ Padr(IntToStr((RGB[1][1] + RGB[0][1]) div 2),3) + ' | G: '+ Padr(inttostr((RGB[1][2] + RGB[0][2]) div 2),3) + ' | B: '+Padr(inttostr((RGB[1][3] + RGB[0][3]) div 2),3));
      Writeln('Middle  RGB color  = '   + IntToStr(RGBToColor((RGB[1][1] + RGB[0][1]) div 2,(RGB[1][2] + RGB[0][2]) div 2,(RGB[1][3] + RGB[0][3]) div 2)));
      Writeln('');
      Writeln('Highest HSL values = H: '+ Padr(FloatToStr(HSL[1][1]),16) +  ' | ' +'S: '+ Padr(FloatToStr(HSL[1][2]),16)  +  ' | ' +'L: '+ Padr(FloatToStr(HSL[1][3]),16) );
      Writeln('Lowest  HSL values = H: '+ Padr(FloatToStr(HSL[0][1]),16) +  ' | ' +'S: '+ Padr(FloatToStr(HSL[0][2]),16)  +  ' | ' +'L: '+ Padr(FloatToStr(HSL[0][3]),16) );
      Writeln('Differ  HSL values = H: '+ Padr(FloatToStr(HSL[1][1] - HSL[0][1]),16) + ' | S: '+ Padr(FloatToStr(HSL[1][2] - HSL[0][2]) ,16) + ' | L: '+Padr(FloatToStr(HSL[1][3] - HSL[0][3]),16));
      Writeln('Middle  HSL values = H: '+ FloatToStr((HSL[1][1] + HSL[0][1]) div 2) + ' | S: '+ FloatToStr((HSL[1][2] + HSL[0][2]) div 2) + ' | L: '+FloatToStr((HSL[1][3] + HSL[0][3]) div 2));
      Writeln('Middle  HSL color  = '   + IntToStr(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)));
      Writeln('');
      Writeln('Highest XYZ values = X: '+ Padr(FloatToStr(XYZ[1][1]),16) +  ' | ' +'Y: '+ Padr(FloatToStr(XYZ[1][2]),16)  +  ' | ' +'Z: '+ Padr(FloatToStr(XYZ[1][3]),16) );
      Writeln('Lowest  XYZ values = X: '+ Padr(FloatToStr(XYZ[0][1]),16) +  ' | ' +'Y: '+ Padr(FloatToStr(XYZ[0][2]),16)  +  ' | ' +'Z: '+ Padr(FloatToStr(XYZ[0][3]),16) );
      Writeln('Differ  XYZ values = X: '+ Padr(FloatToStr(XYZ[1][1] - XYZ[0][1]),16) + ' | Y: '+ Padr(FloatToStr(XYZ[1][2] - XYZ[0][2]) ,16) + ' | Z: '+Padr(FloatToStr(XYZ[1][3] - XYZ[0][3]),16));
      Writeln('Middle  XYZ values = X: '+ FloatToStr((XYZ[1][1] + XYZ[0][1]) div 2) + ' | Y: '+ FloatToStr((XYZ[1][2] + XYZ[0][2]) div 2) + ' | Z: '+FloatToStr((XYZ[1][3] + XYZ[0][3]) div 2));
      Writeln('Middle  XYZ color  = '   + IntToStr(XYZToColor((XYZ[1][1] + XYZ[0][1]) div 2,(XYZ[1][2] + XYZ[0][2]) div 2,(XYZ[1][3] + XYZ[0][3]) div 2)));
      WritelN('');
    end.

    Anyways, if you need some help or just get stuck with something then feel free to contact me via PM and if you wish then I can provide you with my MSN as well.
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

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

    Default

    Should help a bit on how to use it: http://wizzup.org/simbadoc/scriptref...lour-tolerance



    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)

  4. #4
    Join Date
    Sep 2010
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you both. I find Masta Raymonds thing hard to follow but Wizzup the examples there are clear and concise. I'll google HSL values and such to get a further understanding

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
  •