functions.html 924 B

12345678910111213141516171819202122232425
  1. ---
  2. layout: documentation
  3. doc-tab: overview
  4. doc-subtab: functions
  5. ---
  6. {% include subnav-overview.html %}
  7. <section class="section">
  8. <div class="container">
  9. <h1 class="title">Functions</h1>
  10. <h2 class="subtitle">Utility functions to calculate colors and other values</h2>
  11. <hr>
  12. <div class="content">
  13. <p>Bulma uses 5 custom functions to help define the values and colors dynamically:</p>
  14. <ul>
  15. <li><code>powerNumber($number, $exp)</code>: calculates the value of a number exposed to another one. Returns a number.</li>
  16. <li><code>colorLuminance($color)</code>: defines if a color is dark or light. Return a decimal number between 0 and 1 where <= 0.5 is dark and > 0.5 is light.</li>
  17. <li><code>findColorInvert($color)</code>: returns either 70% transparent black or 100% opaque white depending on the luminance of the color.</li>
  18. </ul>
  19. </div>
  20. </div>
  21. </section>