Commit 83a0df55 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

the color palette index should be interpreted as one-based

parent b8989c7f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -22,14 +22,14 @@ const std::unordered_map<
  {
    "fnord",
    {
      "#3d96ae",
      "#4572a7",
      "#aa4643",
      "#db843d",
      "#89a54e",
      "#80699b",
      "#3d96ae",
    }
  }
  },
};

ReturnCode color_palette_default(const std::string& name, ColorPalette* colors) {
+2 −1
Original line number Diff line number Diff line
@@ -36,7 +36,8 @@ ReturnCode color_read(
    // color palette index
    if (StringUtil::isDigitString(value)) {
      if (!env.color_palette.empty()) {
        *color = env.color_palette[std::stoul(value) % env.color_palette.size()];
        *color = env.color_palette[
            (std::stol(value) - 1) % env.color_palette.size()];
      }

      return OK;
+8 −8
Original line number Diff line number Diff line
<svg xmlns="http://www.w3.org/2000/svg" width="3600.000000" height="1920.000000" viewBox="0 0 3600 1920">
  <rect width="3600.000000" height="1920.000000" fill="#ffffff"/>
  <text x="163.333333" y="117.666667" fill="#000000" font-size="77.777778" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">Test Color 1</text>
  <path fill="#cc0000" d="M118.611 90.6667 M60.2778 90.6667 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
  <path fill="#00cc00" d="M118.611 90.6667 M60.2778 90.6667 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
  <text x="163.333333" y="229.000000" fill="#000000" font-size="77.777778" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">Test Color 2</text>
  <path fill="#0000cc" d="M118.611 202 M60.2778 202 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
  <path fill="#cc0000" d="M118.611 202 M60.2778 202 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
  <text x="163.333333" y="340.333333" fill="#000000" font-size="77.777778" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">Test Color 3</text>
  <path fill="#00cc00" d="M118.611 313.333 M60.2778 313.333 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
  <path fill="#0000cc" d="M118.611 313.333 M60.2778 313.333 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
  <text x="163.333333" y="451.666667" fill="#000000" font-size="77.777778" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">Test Color 4</text>
  <path fill="#cc0000" d="M118.611 424.667 M60.2778 424.667 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
  <path fill="#00cc00" d="M118.611 424.667 M60.2778 424.667 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
  <text x="163.333333" y="563.000000" fill="#000000" font-size="77.777778" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">Test Color 5</text>
  <path fill="#0000cc" d="M118.611 536 M60.2778 536 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
  <path fill="#cc0000" d="M118.611 536 M60.2778 536 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
  <text x="163.333333" y="674.333333" fill="#000000" font-size="77.777778" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">Test Color 6</text>
  <path fill="#00cc00" d="M118.611 647.333 M60.2778 647.333 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
  <path fill="#0000cc" d="M118.611 647.333 M60.2778 647.333 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
  <text x="163.333333" y="785.666667" fill="#000000" font-size="77.777778" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">Test Color 7</text>
  <path fill="#cc0000" d="M118.611 758.667 M60.2778 758.667 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
  <path fill="#00cc00" d="M118.611 758.667 M60.2778 758.667 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
  <text x="163.333333" y="897.000000" fill="#000000" font-size="77.777778" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">Test Color 8</text>
  <path fill="#0000cc" d="M118.611 870 M60.2778 870 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
  <path fill="#cc0000" d="M118.611 870 M60.2778 870 a29.1667 29.1667 0 1 0 58.3333 0 a29.1667 29.1667 0 1 0 -58.3333 0 "/>
</svg>
 No newline at end of file
+6 −6
Original line number Diff line number Diff line
@@ -70,12 +70,12 @@ The following color palletes are built in and can be referenced by name:
  <tr>
    <td><code>fnord</code></td>
    <td>
      <span style="color: #3d96ae;" class="color_legend"><small>1</small></span>
      <span style="color: #4572a7;" class="color_legend"><small>2</small></span>
      <span style="color: #aa4643;" class="color_legend"><small>3</small></span>
      <span style="color: #db843d;" class="color_legend"><small>4</small></span>
      <span style="color: #89a54e;" class="color_legend"><small>5</small></span>
      <span style="color: #80699b;" class="color_legend"><small>6</small></span>
      <span style="color: #4572a7;" class="color_legend"><small>1</small></span>
      <span style="color: #aa4643;" class="color_legend"><small>2</small></span>
      <span style="color: #db843d;" class="color_legend"><small>3</small></span>
      <span style="color: #89a54e;" class="color_legend"><small>4</small></span>
      <span style="color: #80699b;" class="color_legend"><small>5</small></span>
      <span style="color: #3d96ae;" class="color_legend"><small>6</small></span>
    </td>
  </tr>
</table>
+8 −8

File changed.

Preview size limit exceeded, changes collapsed.

Loading