![]() ![]() If you aren't on SQL server, it should be easy to adapt to your database. It takes the hex color value as a char(6) value and returns a table with R, G, and B columns. This is a table valued function I just wrote up. From within vim, open the file with :tabe ++binary myfile.bmp and then use :xxd to convert to the hex dump. ![]() The -b tells vim to open it in binary mode, which (among other things) disables the newline at the end. ![]() ,16 * 3, 1), '0123456789abcdef') - 1) + 4, 1), Open the file with vim -b myfile.bmp and then use :xxd to convert to the hex dump. You can also use an inline table-valued UDF: CREATE FUNCTION dbo.udf_HexToRGB char(6)) I generally avoid scalar functions if at all possible, since it is possible to lure yourself into thinking that it's OK to call a scalar UDF for 5 million rows without any penalty over the inline expression. SET = '0123456789abcdef' - Assuming case-insensitive collation! INSERT INTO ('3333CC') - Should convert to Red: 51 Green: 51 Blue: 204 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |