Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6096987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:59:27+00:00 2026-05-23T12:59:27+00:00

I was looking around without any luck how to convert some color code into

  • 0

I was looking around without any luck how to convert some color code into plain RGB (255,255,255). I have this kind of number like

5953244  Yellow
12868826 Pink
12356730 Pale Blue
5758835  Green

I truly don’t understand how to take this numbers and process them into regular RGB or what kind of RGB type are.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:59:28+00:00Added an answer on May 23, 2026 at 12:59 pm

    An int is large enough to hold an ARGB value or any order (RGBA, BGR) and the int value itself is not as important as the individual bytes it contains. Different color spaces requires different bitwise operations since the channel will be located at different bytes. The following is an example that would work for RGB and ARGB.

    #define R(rgb) ((rgb) >> 16 & 0xFF)
    #define G(rgb) ((rgb) >> 8 & 0xFF)
    #define B(rgb) ((rgb) & 0xFF)
    
    int main(int argc, char *argv[])
    {
        int pale_blue = 5953244;
        printf("\nR: 0x%02X G: 0x%02X B: 0x%02X\nR: %03d G: %03d B: %03d", 
            R(pale_blue), G(pale_blue), B(pale_blue), 
            R(pale_blue), G(pale_blue), B(pale_blue));
    }
    

    Output:

    R: 0x5A  G: 0xD6  B: 0xDC
    R: 090    G: 214    B: 220

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After looking around (for not terribly long I have to admit) I wonder if
I'm looking around for a Java code signing certificate so my Java applets don't
I've been looking around for some decent tutorials on .NET remoting (old style MarshallByRef),
I have been looking around for solutions, and tried to implement what is often
I've been looking around for quite a while and feel that I have a
I have been looking around ocn Google and Stackoverflow but haven't found what I
I have been looking all over the Internet for an answer to this question
I have written some code based on a specification from my boss. A requirement
I have been looking around for other OBJ file loaders and I found obj2opengl
I am looking to build some reports for Quickbooks data, without using Quickbooks built-in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.