# Variable Types

WARNING

The chances are very high that we will send json strings instead of xml strings and this page will need to be updated accordingly

# AppearanceAttributeEffect

Effect Attribute Type Default
ConvertToShape
size String RELATIVE
mode String ABSOLUTE
extraWidth Number 10
extraHeight Number 10
unit String px

# AppearanceFill

Attribute Type Default
fillColor String rgb(0, 0, 0)
overprintFill Boolean false
evenodd Boolean false
XML tags Attributes Type Default
<color> Object null
<swatch> String
<global> Boolean true
<cyan> Number 0 (0 - 1)
<magenta> Number 0 (0 - 1)
<yellow> Number 0 (0 - 1)
<black> Number 0 (0 - 1)
<red> Number 0 (0 - 255)
<green> Number 0 (0 - 255)
<blue> Number 0 (0 - 255)
<l> Number 0 (0 - 100)
<a> Number 0 (-128 - 127)
<b> Number 0 (-128 - 127)
<tag> String

TIP

If a swatch name is given then that swatch would be used.
If both a swatch name and a color value are given then a new swatch would be generated or a current swatch would be changed using the given values.
If an existing CMYK swatch was assigned rgb colors then it should be switched to an rgb swatch. This needs more thought 🤔 As of now gradients and patterns need to be provided by the user and applied using the swatch names. Having access to book colors is a planned feature. Perhaps in the future we will allow for gradient generation. Pattern generation looks improbable 😁
P.s. I will try figure out how to change this from a tip to a note some point this year.

<cmd>
  <tag>dog_fill,cat_fill</tag>
  <fill>
    <color>
      <swatch>dogPatternSwatch</swatch>
    </color>
  </fill>
</cmd>
<cmd>
  <tag>dog_fill</tag>
  <fill>
    <color>
      <cyan>0.5</cyan>
      <magenta>0.5</magenta>
      <yellow>0.5</yellow>
      <black>0.5</black>
    </color>
  </fill>
</cmd>
// Will create / modify the swatch "Lab_Green"
// and apply it to objects tagged "dog_fill" or "cat_fill"
{
  "tag": ["dog_fill" , "cat_fill"], // or possibly "dog_fill,cat_fill"
  "fill": {
      "swatch": {
        "name": "Lab_Green",
        "global": true,
        "type": "lab",
        "l": 100,
        "a": -128,
        "b": 127
      }
  }
}

swatch("Summer ()", lab(100,-128,127), true) sheet(0).a[1] = 3cm|swatch("Summer, ()", lab(100,-128,127), true) Plain Swatch Summer Swatch with brackets "Summer(2)" Summer(2) = We don't know what you want from us!

::: theorem Newton's First Law In an inertial frame of reference, an object either remains at rest or continues to move at a constant velocity, unless acted upon by a force. :::

::: right From Wikipedia :::

Note

Tip container of @vuepress/theme-default

// Will apply the swatch "Lab_Green" to objects tagged "dog_fill" or "cat_fill"
{
  "tag": ["dog_fill" , "cat_fill"], // or possibly "dog_fill,cat_fill"
  "fill": {
      "swatch": {
        "name": "Lab_Green"
      }
  }
}
// Will apply the color to objects tagged "dog_fill" or "cat_fill"
{
  "tag": ["dog_fill" , "cat_fill"], // or possibly "dog_fill,cat_fill"
  "fill": {
      "color": {
        "type": "lab",
        "l": 100,
        "a": -128,
        "b": 127
      }
  }
}
Note: We need to discus the JSON formats written here!

# AppearanceStroke

Attribute Type Default
strokeWidth Number 1
strokeColor String rgb(0, 0, 0)
strokeCap String BUTTENDCAP
strokeJoin String MITERENDJOIN
overprintStroke Boolean false
XML tags Attributes Type Default
<weight> Number 1
<color> Object null
<swatch> String
<cyan> Number 0 (0 - 1)
<magenta> Number 0 (0 - 1)
<yellow> Number 0 (0 - 1)
<black> Number 0 (0 - 1)
<red> Number 0 (0 - 255)
<green> Number 0 (0 - 255)
<blue> Number 0 (0 - 255)
<cmd>
  <tag>dog_stroke</tag>
  <stroke>
    <color>
      <swatch>dog_stroke_pattern</swatch>
    </color>
    <weight>2</weight>
  </stroke>
</cmd>
<cmd>
  <tag>dog_stroke</tag>
  <stroke>
    <color>
      <red>255</red>
      <green>0</green>
      <blue>50</blue>
    </color>
    <weight>2</weight>
  </stroke>
</cmd>

# ObjectFill

Attribute Type Default
fillColor String rgb(0, 0, 0)
overprintFill Boolean false
evenodd Boolean false
XML tags Attributes Type Default
<color> Object null
<swatch> String
<cyan> Number 0 (0 - 1)
<magenta> Number 0 (0 - 1)
<yellow> Number 0 (0 - 1)
<black> Number 0 (0 - 1)
<red> Number 0 (0 - 255)
<green> Number 0 (0 - 255)
<blue> Number 0 (0 - 255)
<cmd>
  <tag>dog_fill</tag>
  <fill>
    <color>
      <swatch>dogPatternSwatch</swatch>
    </color>
  </fill>
</cmd>
<cmd>
  <tag>dog_fill</tag>
  <fill>
    <color>
      <cyan>0.5</cyan>
      <magenta>0.5</magenta>
      <yellow>0.5</yellow>
      <black>0.5</black>
    </color>
  </fill>
</cmd>

# ObjectPosition

Attribute Type Default
top Number 1
left Number 1
unit String px

# ObjectStroke

Attribute Type Default
strokeWidth Number 1
strokeColor String rgb(0, 0, 0)
strokeCap String BUTTENDCAP
strokeJoin String MITERENDJOIN
overprintStroke Boolean false
XML tags Attributes Type Default
<weight> Number 1
<color> Object null
<swatch> String
<cyan> Number 0 (0 - 1)
<magenta> Number 0 (0 - 1)
<yellow> Number 0 (0 - 1)
<black> Number 0 (0 - 1)
<red> Number 0 (0 - 255)
<green> Number 0 (0 - 255)
<blue> Number 0 (0 - 255)
<cmd>
  <tag>dog_stroke</tag>
  <stroke>
    <color>
      <swatch>dog_stroke_pattern</swatch>
    </color>
    <weight>2</weight>
  </stroke>
</cmd>
<cmd>
  <tag>dog_stroke</tag>
  <stroke>
    <color>
      <red>255</red>
      <green>0</green>
      <blue>50</blue>
    </color>
    <weight>2</weight>
  </stroke>
</cmd>