Jump to content

From R G B to Hex ?


darhal

Recommended Posts

Posted

as the title said how to convert r g b to hex

? thx :lol:

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted (edited)

No r, g, b convert it to #FFFFFF smthg like this

Edited by Guest

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

Thx :) You are the best ever

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

Wait i want to convert r g b to hex to use it in a string i want 3 different colors in one string any examples ?

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

How to use it inside a string ?

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

Example:

string1 = string.format("%.2X%.2X%.2X", 255, 0, 0).."Red" 
string2 = string.format("%.2X%.2X%.2X", 0, 255, 0).."Green" 
string3 = string.format("%.2X%.2X%.2X", 0, 0, 255).."Blue" 
outputChatBox(string1..", "..string2..", "..string3, 255, 255, 255, true) 
  
--Same as: 
string1 = string.format("%.2X%.2X%.2X", 255, 0, 0) 
string2 = string.format("%.2X%.2X%.2X", 0, 255, 0) 
string3 = string.format("%.2X%.2X%.2X", 0, 0, 255) 
outputChatBox(string1.."Red, "..string2.."Green, "..string3.."Blue", 255, 255, 255, true) 

Posted

Thx a lot

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...