Skip to contents

In the app, subcodes are always shown in the colour of their top-level code; changing the colour of a top-level code therefore re-colours the whole code family. With family = TRUE (default) the stored colour of all subcodes is updated as well, so exports show the same colour.

Usage

qda_code_set_color(code, color, family = TRUE)

Arguments

code

Code id or unique label.

color

New colour as "#RRGGBB".

family

Logical; also set the colour of all subcodes.

Value

Invisibly, a one-row tibble with the updated code.

Examples

qda_open(file.path(tempfile(), "example.jellyqda"))
qda_import(system.file("extdata", "interview_01.txt", package = "jellyqda"))
#> # A tibble: 1 × 5
#>      id name             format chars status
#>   <int> <chr>            <chr>  <int> <chr> 
#> 1     1 interview_01.txt txt      856 ok    
qda_code_add("Career path")
qda_code_add("SME", parent = "Career path")
qda_code_set_color("Career path", "#0072B2")   # whole code family
qda_codes()$color
#> [1] "#0072B2" "#0072B2"
qda_close()