| 1 | package Treex::Core::TredView::Colors; | ||||||||||
| 2 | { | ||||||||||
| 3 | 3 | $Treex::Core::TredView::Colors::VERSION = '0.08633_1'; | |||||||||
| 4 | } | ||||||||||
| 5 | |||||||||||
| 6 | 3 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 3 | ▶ | use Treex::Core::Log; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 3 | has '_colors' => ( | |||||||||
| 10 | is => 'ro', | ||||||||||
| 11 | isa => 'HashRef[Str]', | ||||||||||
| 12 | builder => '_build_colors' | ||||||||||
| 13 | ); | ||||||||||
| 14 | |||||||||||
| 15 | sub _build_colors { | ||||||||||
| 16 | return { | ||||||||||
| 17 | 0 | ▶ | 'edge' => '#555555', | ||||||||
|
Subroutine
_build_colors: not called CC=1 SCAR=6.9
| |||||||||||
| 18 | 'coord' => '#bbbbbb', | ||||||||||
| 19 | 'error' => '#ff0000', | ||||||||||
| 20 | 'coord_mod' => 'aquamarine4', | ||||||||||
| 21 | |||||||||||
| 22 | 'anode' => '#ff6666', | ||||||||||
| 23 | 'anode_coord' => '#ff6666', | ||||||||||
| 24 | 'nnode' => '#ffff00', | ||||||||||
| 25 | 'tnode' => '#4488ff', | ||||||||||
| 26 | 'tnode_coord' => '#ccddff', | ||||||||||
| 27 | 'terminal' => '#ffff66', | ||||||||||
| 28 | 'terminal_head' => '#90ee90', | ||||||||||
| 29 | 'nonterminal_head' => '#90ee90', | ||||||||||
| 30 | 'nonterminal' => '#ffffe0', | ||||||||||
| 31 | 'trace' => '#aaaaaa', | ||||||||||
| 32 | 'current' => '#ff0000', | ||||||||||
| 33 | |||||||||||
| 34 | 'coref_gram' => '#c05633', | ||||||||||
| 35 | 'coref_text' => '#4c509f', | ||||||||||
| 36 | 'compl' => '#629f52', | ||||||||||
| 37 | 'alignment' => '#bebebe', | ||||||||||
| 38 | 'coindex' => '#ffa500', #orange | ||||||||||
| 39 | |||||||||||
| 40 | 'lex' => '#006400', | ||||||||||
| 41 | 'aux' => '#ff8c00', | ||||||||||
| 42 | 'parenthesis' => '#809080', | ||||||||||
| 43 | 'afun' => '#00008b', | ||||||||||
| 44 | 'member' => '#0000ff', | ||||||||||
| 45 | 'sentmod' => '#006400', | ||||||||||
| 46 | 'subfunctor' => '#a02818', | ||||||||||
| 47 | 'nodetype' => '#00008b', | ||||||||||
| 48 | 'sempos' => '#8b008b', | ||||||||||
| 49 | 'phrase' => '#00008b', | ||||||||||
| 50 | 'formeme' => '#b000b0', | ||||||||||
| 51 | 'tag' => '#004048', | ||||||||||
| 52 | 'tag_feat' => '#7098A0', | ||||||||||
| 53 | |||||||||||
| 54 | 'clause0' => '#ff00ff', #magenta | ||||||||||
| 55 | 'clause1' => '#ffa500', #orange | ||||||||||
| 56 | 'clause2' => '#0000ff', #blue | ||||||||||
| 57 | 'clause3' => '#3cb371', #MediumSeaGreen | ||||||||||
| 58 | 'clause4' => '#ff0000', #red | ||||||||||
| 59 | 'clause5' => '#9932cc', #DarkOrchid | ||||||||||
| 60 | 'clause6' => '#00008b', #DarkBlue | ||||||||||
| 61 | 'clause7' => '#006400', #DarkGreen | ||||||||||
| 62 | 'clause8' => '#8b0000', #DarkRed | ||||||||||
| 63 | 'clause9' => '#008b8b', #DarkCyan | ||||||||||
| 64 | }; | ||||||||||
| 65 | } | ||||||||||
| 66 | |||||||||||
| 67 | sub get { | ||||||||||
| 68 | 0 | ▶ | my ( $self, $code, $markup ) = @_; | ||||||||
|
Subroutine
get: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 69 | 0 | ▶ | if ( not exists $self->_colors->{$code} ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 70 | 0 | log_fatal "Unknown color code '$code'\n"; | |||||||||
| 71 | } | ||||||||||
| 72 | 0 | $code = $self->_colors->{$code}; | |||||||||
| 73 | 0 | ▶ | return $markup ? '#{' . $code . '}' : $code; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 74 | } | ||||||||||
| 75 | |||||||||||
| 76 | sub get_clause_color { | ||||||||||
| 77 | 0 | ▶ | my ( $self, $clause_number, $code, $markup ) = @_; | ||||||||
|
Subroutine
get_clause_color: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 78 | 0 | return $self->get( 'clause' . ( $clause_number % 10 ), $markup ); | |||||||||
| 79 | } | ||||||||||
| 80 | |||||||||||
| 81 | 3 | 1; | |||||||||
| 82 | |||||||||||