diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..720581b --- /dev/null +++ b/main.cpp @@ -0,0 +1,21 @@ +#include + +using namespace std; +const int RGB_HEX_LENGTH = 7; + +int main(){ + string input; + + do{ + cout << "Enter a color in hex format (#RRGGBB):"; + getline(cin, input); + + if( input.size() != RGB_HEX_LENGTH ){ + cout << "Please enter the color in hexadecimal format, starting with # followed by six hex values\n"; + } + }while( input.size() != RGB_HEX_LENGTH ); + + cout << "Your hex color is: " << input << endl; + + return 0; +} \ No newline at end of file