Styling of Text blocks added with Editor.addBlock in a TextDocument
N
Nicolas Morin
started a topic
over 3 years ago
I am trying to apply color to new Text blocks added to a Text Document part.
The blocks are added with code similar to this:
editor.addBlock(x, y, "Text", MimeType.TEXT, textValue);
I tried setting the color for Text blocks to green as follows:
editor.setTheme(".text { color: #00FF00FF; }");
However, the text in the blocks I add is the default black so it looks like setting the theme has no impact on addBlock. The color of handwritten stuff however is changed to green so it looks like setTheme() was indeed applied.
Is it possible to set a color to newly created Text blocks?
Thank you!
Best Answer
O
Olivier @MyScript
said
over 3 years ago
Dear Nicolas,
currently, the color will apply to all the objects of the editor. Therefore, you cannot set a color only to a specific block.
Nicolas Morin
I am trying to apply color to new Text blocks added to a Text Document part.
The blocks are added with code similar to this:
I tried setting the color for Text blocks to green as follows:
However, the text in the blocks I add is the default black so it looks like setting the theme has no impact on addBlock. The color of handwritten stuff however is changed to green so it looks like setTheme() was indeed applied.
Is it possible to set a color to newly created Text blocks?
Thank you!
Dear Nicolas,
currently, the color will apply to all the objects of the editor. Therefore, you cannot set a color only to a specific block.
Best regards,
Olivier
- Oldest First
- Popular
- Newest First
Sorted by PopularNicolas Morin
Just to clarify, I set the theme above once, when the app starts. So before editor.addBlock() is called.
Olivier @MyScript
Dear Nicolas,
currently, the color will apply to all the objects of the editor. Therefore, you cannot set a color only to a specific block.
Best regards,
Olivier