title: Update the options in ChartJS permanently
body: <p>I added a darkmode function to my website but the problem is the font color of options.title not permanently changing. Changing color when the darkmode is on/off is working but when refresh the page, the font color is back to standard.</p>
  <p>I am using a local storage to my darkmode function. The other elements is changing and saving but only the font color of my title is not. I tried different algorithms and also searching but I don't see a same problem.</p>
  <p>JS Code:</p>
  <pre><code>    var budget_dates = JSON.parse(budget_date)
      var budgets = JSON.parse(budget)
      var savings = JSON.parse(savings)
      var numbers = [1, 2, 3, 4, 5]
  
      let myChart = document.getElementById('myChart').getContext('2d');
      let gradient = myChart.createLinearGradient(0, 0, 0, 450);
  
      gradient.addColorStop(0, 'rgba(40,175,250,.25)');
      gradient.addColorStop(1, 'rgba(40,175,250,0)');
  
  
      let BudgetChart = new Chart(myChart, {
        type: 'line',
        data: {
          labels: budget_dates,
          datasets: [{
            data: budgets,
            backgroundColor: gradient,
            pointBackgroundColor: 'white',
            borderWidth: 1,
            borderColor: '#28AFFA',
          }]
        },
        options: {
          responsive: true,
          maintainAspectRatio: false,
          legend: {
            display: false
          },
          title: {
            display: true,
            text: 'Budget'
          }
  
        }
      })
  
      let pieChart = document.getElementById('pieChart').getContext('2d');
      let labels = ['Food', 'Clothes', 'Bills/Payment', 'Transportation', 'Basic Necessities']
  
      let ExpenseChart = new Chart(pieChart, {
        type: 'pie',
        data: {
          labels: labels,
          datasets: [{
            data: [food, clothes, bills, transportation, necessities],
            backgroundColor: [&quot;#276bf2&quot;, &quot;#93aefd&quot;, &quot;#ecf1ff&quot;, &quot;#8598c7&quot;, &quot;#00488f&quot;]
          }]
        },
        options: {
          responsive: true,
          maintainAspectRatio: false,
          title: {
            display: true,
            text: 'Expenses'
          }
  
        }
      })
  
      let barChart = document.getElementById('barChart').getContext('2d');
      let SavingsChart = new Chart(barChart, {
        type: 'bar',
        data: {
          labels: budget_dates,
          datasets: [{
            data: savings,
            backgroundColor: gradient,
            pointBackgroundColor: 'white',
            borderWidth: 1,
            borderColor: '#28AFFA',
          }]
        },
        options: {
          responsive: true,
          maintainAspectRatio: false,
          legend: {
            display: false
          },
          title: {
            display: true,
            text: 'Savings'
          }
        }
      })
  
  
      let titleColorChange = localStorage.getItem(&quot;titleColorChange&quot;)
      const toggleChange = document.querySelector(&quot;#dark-mode-toggle&quot;);
  
  
      const enableColorChange = () =&gt; {
        BudgetChart.config.options.title.fontColor = 'black'
        ExpenseChart.config.options.title.fontColor = 'black'
        SavingsChart.config.options.title.fontColor = 'black'
        BudgetChart.update()
        ExpenseChart.update()
        SavingsChart.update()
        localStorage.setItem('titleColorChange', 'enabled')
      }
  
      const disableColorChange = () =&gt; {
        BudgetChart.config.options.title.fontColor = 'black'
        ExpenseChart.config.options.title.fontColor = 'black'
        SavingsChart.config.options.title.fontColor = 'black'
        BudgetChart.update()
        ExpenseChart.update()
        SavingsChart.update()
        localStorage.setItem('titleColorChange', null)
      }
  
      if (titleColorChange === 'enabled') {
        enableColorChange();
      }
  
      toggleChange.addEventListener(&quot;click&quot;, () =&gt; {
        titleColorChange = localStorage.getItem(&quot;titleColorChange&quot;);
        if (titleColorChange !== 'enabled') {
          enableColorChange();
        } else {
          disableColorChange();
        }
      });
  
      localStorage.setItem('titleColorChange', titleColorChange)
  </code></pre>
  <p>The  <code>titleColorChange</code> is saving in the local storage but not <code>update()</code> function of ChartJS.</p>