Results 1 to 11 of 11

Thread: mixing color

  1. #1

    Thread Starter
    Hyperactive Member Sneeden's Avatar
    Join Date
    Oct 2001
    Location
    Sneedville
    Posts
    258

    mixing color

    I have two colors. I need to add the R, G, & B components and return a new color. I am having trouble.
    balls deep in bad code

  2. #2
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: mixing color

    How do you store the colours? And how do you want to mix them?


    - ØØ -

  3. #3
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: mixing color

    well simply do
    int r, g, b;
    r = color1.R +color2.R .....
    same with g and b


    then check to see if any of the new r g b values exceed 255. If so, set them to 255
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: mixing color

    There is THREE ways of handling oversaturated colours. Clamping, scaling, and clipping...


    - ØØ -

  5. #5
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: mixing color

    Quote Originally Posted by NoteMe
    There is THREE ways of handling oversaturated colours. Clamping, scaling, and clipping...


    - ØØ -
    shut up
    you should have a phd in this field by now why don't you post about those
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  6. #6
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: mixing color

    Because I am lazy. I don't want to write 3 pages if he doesn't care about it..


    ANd yes..where is my Ph.d...



    - ØØ -

  7. #7

    Thread Starter
    Hyperactive Member Sneeden's Avatar
    Join Date
    Oct 2001
    Location
    Sneedville
    Posts
    258

    Re: mixing color

    well simply do
    int r, g, b;
    r = color1.R +color2.R .....
    same with g and b
    This is actually what I tried before posting. The properties are read only.
    balls deep in bad code

  8. #8
    Fanatic Member
    Join Date
    May 2005
    Posts
    898

    Re: mixing color

    Quote Originally Posted by Sneeden
    This is actually what I tried before posting. The properties are read only.
    Yes but you can create a new color from the new numbers and use that.
    "so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman

  9. #9
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: mixing color

    Quote Originally Posted by Sneeden
    This is actually what I tried before posting. The properties are read only.
    yes just add the values to integer variables as I said (int r, g, b

    then do Color newColor = Color.FromArgb (0, r,g,b);
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  10. #10

    Thread Starter
    Hyperactive Member Sneeden's Avatar
    Join Date
    Oct 2001
    Location
    Sneedville
    Posts
    258

    Re: mixing color

    Thx Mr Polite. I missed that function. It only has the r,g,b args, no alpha.
    1000 appreciations.

    Sneed
    balls deep in bad code

  11. #11
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: mixing color

    Quote Originally Posted by Sneeden
    Thx Mr Polite. I missed that function. It only has the r,g,b args, no alpha.
    1000 appreciations.

    Sneed
    you're welcome read my signature
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

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



Click Here to Expand Forum to Full Width