Thread: Colorref

  1. #1
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331

    Colorref

    Hello all, one of my sample programs has

    Code:
    SetTextColor(hDC, COLORREF(0x00FF0000));
    in it. I know how this works and what it is, i was just wondering if theres a well known site listing the values/colors they represent? I'm downloading and working with code so i don't really have time to look right now, so i figured i'd ask..thnx for the help.

  2. #2
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    You could go into photoshop and set the color there, and copy and paste the hex value it outputs in the little box. I'm not sure if paint does this, though, if you don't have photoshop.

  3. #3
    Attack hamster fuh's Avatar
    Join Date
    Dec 2002
    Posts
    176
    It gives me white (like the text box I'm typing in right now!) in Macromedia Fireworks.
    ~Fuh
    Stupid things pop singers say

    "I get to go to lots of overseas places, like Canada."
    - Britney Spears

    "I love what you've done with the place!"
    -Jessica Simpson upon meeting the Secretary of Interior during tour of the White House

  4. #4
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    i have PS, thnx for the idea:

    the hex i pasted is blue, fuh.

  5. #5
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    You do know about the RGB macro right? That returns a COLORREF...

    Code:
    RGB( 255, 0, 0 );
    For pure red. Each is an unsigned char ( 0 - 255 ). Enjoy.

  6. #6
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    COLORREF is just a typedef of an integer. Since an int is 4 bytes and each color is 1 byte then we are just packing the three colors into the COLORREF variable so to store and transport it easier.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. COLORREF GetPixel(); Help
    By JordanCason in forum C++ Programming
    Replies: 10
    Last Post: 11-21-2007, 12:23 AM
  2. Extracting COLORREF
    By Queatrix in forum Windows Programming
    Replies: 2
    Last Post: 12-20-2006, 12:41 PM
  3. colorref and setpixel
    By bballzone in forum C++ Programming
    Replies: 19
    Last Post: 09-11-2004, 06:09 PM
  4. Odd program crashes
    By Mithoric in forum Windows Programming
    Replies: 3
    Last Post: 03-20-2004, 11:37 PM
  5. Making COLORREF lighter
    By Mithoric in forum Windows Programming
    Replies: 1
    Last Post: 03-02-2004, 04:32 AM