Editorial Workflows

Text Colour

public workflow

Install Workflow...

This workflow contains at least one Python script. Only use it if you trust the person who shared this with you, and if you know exactly what it does.

I understand, install the workflow!

This is a workflow for Editorial, a Markdown and plain text editor for iOS. To download it, you need to view this page on a device that has the app installed.

Description: Select the text first
and then select to change colour/highlight

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Select from List ?
Title
Color/Highlight?
List (Lines)
Red Green Blue Highlight Red Highlight Green Highlight Blue Highlight Yellow
Multiple Selection
OFF
Show in Popover
OFF
Set Variable ?
Variable Name
choiceSelected
Value
Input
Run Python Script ?
Source Code
#coding: utf-8
import workflow

action_in = workflow.get_input()
action_out = 'colorCode'

if action_in == 'Red':
	action_out = 'FF2F6E';
elif action_in == 'Green':
	action_out = '2B823A';
elif action_in == 'Blue':
	action_out = '33ACFF';
elif action_in == 'Highlight Red':
	action_out = 'FF6BB3';
elif action_in == 'Highlight Green':
	action_out = '2B823A';
elif action_in == 'Highlight Blue':
	action_out = '42FF00';
elif action_in == 'Highlight Yellow':
	action_out = 'FFF000';

workflow.set_output(action_out)
Set Variable ?
Variable Name
colorCode
Value
Input
If… ?
Run the block if
choiceSelected
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Highlight
Replace Selected Text ?
Replacement Text
<span style="background-color:#colorCode">Selected Text</span>
…End If
If… ?
Run the block if
choiceSelected
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Highlight
Replace Selected Text ?
Replacement Text
<span style="color:#colorCode">Selected Text</span>
…End If