📄 rgb2long.txt
字号:
//**************************************
//
// Name: Convert 3 values (R,G&B) into a
// Long value of the color
// Description:The code take three value
// s REd, Green and Blue and returns a Long
// form of the Compleate color
// By: Robert 'Bob' Engelhardt
//
// Inputs:Red, Green, Blue each as an in
// t
//
// Returns:Color as a long value
//
// Assumes:nothing fancy just quick and
// simnple code
//
long MakeColor(int Red,int Green,int Blue)
{
// constrain to be proper size
if(Red > 255) Red =255;
if(Red<0) Red=0;
if(Green > 255) Green=255;
if(Green<0) Green=0;
if(Blue > 255) Blue=255;
if(Blue<0) Blue=0;
Red*=65536; // add trailing zeros in hex (XX0000)
Green*=256; // add trailing zeros in hex ( XX00)
return(Red+Green+Blue);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -