问题
Below example of normal fill color.
$requests[] = new \Google_Service_Slides_Request(array(
'updateShapeProperties' => array(
'objectId' => "elementID",
'fields' => "shapeBackgroundFill.solidFill.color",
'shapeProperties' => array(
'shapeBackgroundFill' => array(
'solidFill' => array(
'color' => array(
'rgbColor' => array(
'red' => "RGBCODE_0",
'green' => "RGBCODE_1",
'blue' => "RGBCODE_2"
),
),
),
),
),
),
)
);
I want to set color like below in google slide by GOOGLE API.
background: linear-gradient(to right, rgba(255,255,255,0.1), rgba(245,185,188,1));
Above code for HTML & CSS.
回答1:
As you can withdraw the Slides API documentation, the only currently present interfaces for ShapeBackgroundFill
are propertyState
and solidFill
.
Gradient fill is unfortunately not an option.
Indeed, even from the user interface it is not possible to implement a custom gradient as shape background fill.
If it is of any help: You can implement a ThemeColor.
If this does not solve your issue, you can file a feature request at Google Public Issue Tracker and hope that the feature will be implemented in the future.
来源:https://stackoverflow.com/questions/59406800/how-can-we-fill-linear-gradient-color-in-google-slide-by-api