How can we fill linear gradient color in google slide by api?

不想你离开。 提交于 2020-01-30 10:58:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!