![]() ![]() I apologise to anyone who objects to my use of "2" instead of the "to". We will also need the corresponding header files, and a file containing the main function to test and demonstrate the code, and code to populate test data. There are also utility functions to validate values held in structs and to split or combine hexadecimal values from/to single strings. This project will consist of a source code file containing structs to hold RGB in decimal or hexadecimal, HSL values and the functions to convert between them. Many people will also be aware of HSL which is a cylindrical coordinate representation of a colour, and is described fully (along with another similar system called HSV) in this Wikipedia article. Most people will be familiar with representing colours in RGB format using either decimal or hexadecimal numbers, for example in CSS you might use In this post I will write code in C to convert colour values between decimal red, green and blue, hexadecimal RGB, and hue, saturation and lightness or HSL.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |