var selectedElements = selection.getSelectedElements();
for (var i = 0; i < selectedElements.length; ++i) {
var selectedElement = selectedElements[i];
// Only modify elements that can be edited as text; skip images and other
// non-text elements.
var text = selectedElement.getElement().editAsText();
// Change the background color of the selected part of the element, or the
// full element if it's completely selected.
if (selectedElement.isPartial()) {
text.setColor(selectedElement.getStartOffset(),
selectedElement.getEndOffsetInclusive(), '#69359c');
}
}
}
上記のテキストは、Google ドキュメント内の選択を取得し、それを 16 進数コード #69359c (濃い紫) に変更します。私は多くの Web サイト、多くの git を検索し、多くの友人にプロジェクトの支援を求めてきました。
私の最終プロジェクトはこれです:
- セレクターで Google Docs のメニューを作成する (DONE)
- 一定量のテキストを強調表示し、色の配列に変更できる (ROY G. BIV / 虹)。
- 形式は Google ドキュメント専用にします。
誰かが私を助けることができれば、それは非常に高く評価されます.