Color (color) to three colors (r/g/B) (Dry Goods sharing), color dry goods
// Color conversion #665522-three-color value
+ (UIColor *) setFontColorWithString :( NSString *) color
{
NSString * cString = [color stringByTrimmingCharactersInSet: [NSCharacterSetwhitespaceAndNewlineCharacterSet] uppercaseString];
// The number of strings must be greater than or equal to 6
If ([cString length] <6 ){
Return [UIColorclearColor];
}
// Differentiate Based on hexadecimal notation
If ([cString hasPrefix: @ "0X"])
CString = [cString substringFromIndex: 2];
If ([cString hasPrefix: @ "#"])
CString = [cString substringFromIndex: 1];
If ([cString length]! = 6)
Return [UIColorclearColor];
// It can be divided into r, g, and B Sub-strings.
Nsange range;
Range. location = 0;
Range. length = 2;
// R
NSString * rString = [cString substringWithRange: range];
// G
Range. location = 2;
NSString * gString = [cString substringWithRange: range];
// B
Range. location = 4;
NSString * bString = [cString substringWithRange: range];
// Scan r, g, and B Values
Unsignedint r, g, B;
[[NSScannerscannerWithString: rString] scanHexInt: & r];
[[NSScannerscannerWithString: gString] scanHexInt: & g];
[[NSScannerscannerWithString: bString] scanHexInt: & B];
Return RgbHex2UIColor (r, g, B );
}
The RGB color value is converted to a hexadecimal color value. Please write down the R, G, and B conversion process.
I don't know what language you are using. A brother has already provided an algorithm. Let me add another VBS algorithm.
Function rgb2hex (r, g, B)
Rgb2hex = "#" & Right ("0" & Hex (r), 2) & Right ("0" & Hex (g), 2) & Right ("0" & Hex (B), 2)
End Function
The idea is very simple. Convert the three colors of red, green, and blue into hexadecimal values respectively. If there are less than two prefixes, 0 is filled, and then strings are connected in the red, green, and blue order, that is, the hexadecimal color value, if it is used in HTML or CSS, It is prefixed #.
What if the printer is partial?
Large printer Color Deviation
First, print the color block to test the ink effect, and then compare it with the color sample to see if it is the reason for ink.
Second: There is a Nozzle Calibration in the printer, and the model nozzle correction color is sold in. After repeated debugging, the color should be correct.
Third: you can find the cause of chromatic aberration in the drawing software.