feat: support more color formats for backgroundColor (#31868)

This commit is contained in:
Shelley Vohr 2022-03-21 18:35:54 +01:00 committed by GitHub
parent 4b8b492b62
commit db79734bfb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 144 additions and 55 deletions

View file

@ -643,11 +643,11 @@ bool BaseWindow::IsTabletMode() const {
}
void BaseWindow::SetBackgroundColor(const std::string& color_name) {
SkColor color = ParseHexColor(color_name);
SkColor color = ParseCSSColor(color_name);
window_->SetBackgroundColor(color);
}
std::string BaseWindow::GetBackgroundColor() {
std::string BaseWindow::GetBackgroundColor(gin_helper::Arguments* args) {
return ToRGBHex(window_->GetBackgroundColor());
}