Extract/Replace a Style Class or Object from PaletteOfStyles

# S4 method for class 'PaletteOfStyles'
x[i, j, ...] <- value

# S4 method for class 'PaletteOfStyles,ANY,ANY,ANY'
x[i, j, ..., drop = FALSE]

# S4 method for class 'PaletteOfStyles'
x[[i, j, ..., exact = TRUE]]

Arguments

x

a PaletteOfStyles object

i

numeric, or character corresponding to a valid style format

j

numeric, or character corresponding to a valid style brightness

...

pass a numeric or character corresponding to a valid color.mode

value

a list of Style class or Style objects

drop

TRUE or FALSE, whether to drop dimensions, defaults to FALSE, which is different than generic

exact

passed on to generic

Value

a Style ClassRepresentation object or Style object for [[, and a list of the same for [

See also

diffPrint for explanations of format, brightness, and color.mode

Examples

pal <- PaletteOfStyles()
pal[["ansi256", "light", "rgb"]]
#> Class "StyleAnsi256LightRgb" [package "diffobj"]
#> 
#> Slots:
#>                                                                        
#> Name:          funs         text      summary    nchar.fun         wrap
#> Class:    StyleFuns    StyleText StyleSummary          ANY      logical
#>                                                                        
#> Name:           pad    finalizer        pager       na.sub    blank.sub
#> Class:      logical     function        Pager    character    character
#>                    
#> Name:    disp.width
#> Class:      integer
#> 
#> Extends: 
#> Class "StyleAnsi", directly
#> Class "Light", directly
#> Class "Rgb", directly
#> Class "StyleRaw", by class "StyleAnsi", distance 2
#> Class "Ansi", by class "StyleAnsi", distance 2
#> Class "Style", by class "StyleAnsi", distance 3
#> Class "Raw", by class "StyleAnsi", distance 3
pal["ansi256", "light", ]
#> 
#> format: ansi256, brightness: light, color.mode: rgb
#> 
#>   Object of class `StyleAnsi256LightRgb`:
#>   
#>   < diffobj:::.mx1   > diffobj:::.mx2 
#>   @@ 6,4 @@          @@ 6,3 @@        
#>   ~       [,1] [,2]  ~       [,1] [,2]
#>      [5,]    5   30     [5,]    5   30
#>   <  [6,]    6   31  >  [6,]   99   31
#>   <  [7,]    7   32  ~                
#>      [8,]    8   33     [7,]    8   33
#>   ... omitted 4/10 lines, 1/2 hunks   
#>   
#>   Default bg and fg colors forced to appropriate colors
#>   for scheme; this does not happen in actual use.
#> 
#> format: ansi256, brightness: light, color.mode: yb
#> 
#>   Object of class `StyleAnsi256LightYb`:
#>   
#>   < diffobj:::.mx1   > diffobj:::.mx2 
#>   @@ 6,4 @@          @@ 6,3 @@        
#>   ~       [,1] [,2]  ~       [,1] [,2]
#>      [5,]    5   30     [5,]    5   30
#>   <  [6,]    6   31  >  [6,]   99   31
#>   <  [7,]    7   32  ~                
#>      [8,]    8   33     [7,]    8   33
#>   ... omitted 4/10 lines, 1/2 hunks   
#>   
#>   Default bg and fg colors forced to appropriate colors
#>   for scheme; this does not happen in actual use.
pal["ansi256", "light", "rgb"] <- list(StyleAnsi8NeutralRgb())