| 234 | } |
| 235 | |
| 236 | uint8_t parseCssInt(const ccstd::string &str) { // int or percentage. |
| 237 | if (str.length() && str.back() == '%') { |
| 238 | return clampCssByte(parseFloat(str) / 100.0f * 255.0f); |
| 239 | } |
| 240 | return clampCssByte(parseInt(str)); |
| 241 | } |
| 242 | |
| 243 | float parseCssFloat(const ccstd::string &str) { // float or percentage. |
| 244 | if (str.length() && str.back() == '%') { |
no test coverage detected