Results 1 to 15 of 15

Thread: RGB to SCAR Colour? How?

  1. #1
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default RGB to SCAR Colour? How?

    Ok, I was looking at this http://java.sun.com/j2se/1.4.2/docs/...awt/Color.html and I was like ._.

    How does SCAR calculate the RGB values of a 'colour' and then turn it into an integer?

    Thanks

  2. #2
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    (R+256*G)*256+B or maybe the other way around

  3. #3
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Actually (B+256*G)*256+R

  4. #4
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Thanks Boreas!

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

    Default

    Double post Boreas! I aughta infract you!

  6. #6
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    SCAR Code:
    program New;
    const
      r = 100;
      g = 100;
      b = 100;
    begin
      WriteLn( RGBtoColor(r, g, b) );
      WriteLn( (r + (g shl 8) + (b shl 16)) );
    end.

    SCAR Code:
    program New;
    const
      c = 13132900;
    var
      r, g, b: Integer;
    begin
      ColorToRGB(c, r, g, b);
      WriteLn(Format('r: %d g: %d b: %d', [r, g, b]));
      r := Byte(c);
      g := Byte(c shr 8);
      b := Byte(c shr 16);
      WriteLn(Format('r: %d g: %d b: %d', [r, g, b]));
    end.

  7. #7
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Thanks nielsie! Helped A LOT
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  8. #8
    Join Date
    Feb 2010
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks,

    I will give this a build this week and let you know =)

    I think I have the most fussiest of Plasma RGB in TV sets... I have tried so many different methods of configuring SCART for the Amiga output it is crazt, what really peeves me is that it would work fine on the CRT tv, just not my plasma!!!

    So it would be nice to be able to put this to bed to be honest!

  9. #9
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    http://villavu.com/forum/showthread.php?t=18514
    Every formula has its explanation


  10. #10
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Except for the DTM formula..
    Interested in C# and Electrical Engineering? This might interest you.

  11. #11
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Which DTM formula?

  12. #12
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    DTM <-> String

    It's only known by three or four people, if I'm correct..
    Interested in C# and Electrical Engineering? This might interest you.

  13. #13
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Smartzkid View Post
    DTM <-> String

    It's only known by three or four people, if I'm correct..
    Well it doesn't require a formula at all ;-). Just a silly way of saving data
    Verrekte Koekwous

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

    Default

    Quote Originally Posted by Smartzkid View Post
    DTM <-> String

    It's only known by three or four people, if I'm correct..
    It's in Simba's source code. Not so secret anymore.



    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)

  15. #15
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Win! Haha finally, I've been wanting to find it out for a while, thanks
    Interested in C# and Electrical Engineering? This might interest you.

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
  •