| | 1916 | if(vm.count("bgcolor")) { |
| | 1917 | vector<double> cc; |
| | 1918 | string v; |
| | 1919 | std::istringstream iss(vm["bgcolor"].as<std::string>()); |
| | 1920 | while(getline(iss, v, ':')) cc.push_back(::atof(v.c_str())); |
| | 1921 | if(cc.size() != 3) |
| | 1922 | { |
| | 1923 | cerr << "You should specify 3 values for background-color." << endl; |
| | 1924 | exit(1); |
| | 1925 | } |
| | 1926 | std::copy(&cc[0], &cc[3], &clear_color[0]); |
| | 1927 | } |
| | 1928 | |
| | 1929 | if(vm.count("top-color")) { |
| | 1930 | vector<double> tc; |
| | 1931 | string v; |
| | 1932 | std::istringstream iss(vm["top-color"].as<std::string>()); |
| | 1933 | while(getline(iss, v, ':')) tc.push_back(::atof(v.c_str())); |
| | 1934 | if(tc.size() != 3) |
| | 1935 | { |
| | 1936 | cerr << "You should specify 3 values for top-color." << endl; |
| | 1937 | exit(1); |
| | 1938 | } |
| | 1939 | std::copy(&tc[0], &tc[3], &top_color[0]); |
| | 1940 | } |
| | 1941 | |
| 1934 | | } |
| 1935 | | |
| 1936 | | if(vm.count("bgcolor")) { |
| 1937 | | vector<double> cc; |
| 1938 | | string v; |
| 1939 | | std::istringstream iss(vm["bgcolor"].as<std::string>()); |
| 1940 | | while(getline(iss, v, ':')) cc.push_back(::atof(v.c_str())); |
| 1941 | | if(cc.size() != 3) |
| 1942 | | { |
| 1943 | | cerr << "You should specify 3 values for background-color." << endl; |
| 1944 | | exit(1); |
| 1945 | | } |
| 1946 | | std::copy(&cc[0], &cc[3], &clear_color[0]); |
| 1947 | | } |
| 1948 | | |
| 1949 | | if(vm.count("top-color")) { |
| 1950 | | vector<double> tc; |
| 1951 | | string v; |
| 1952 | | std::istringstream iss(vm["top-color"].as<std::string>()); |
| 1953 | | while(getline(iss, v, ':')) tc.push_back(::atof(v.c_str())); |
| 1954 | | if(tc.size() != 3) |
| 1955 | | { |
| 1956 | | cerr << "You should specify 3 values for top-color." << endl; |
| 1957 | | exit(1); |
| 1958 | | } |
| 1959 | | std::copy(&tc[0], &tc[3], &top_color[0]); |