Fix RGB/RYB conversions and brushes not updating their icon after mixing. Also update some docu on paintTool.js (#31643)

This commit is contained in:
jellyveggie2
2021-12-16 03:41:27 +01:00
committed by GitHub
parent 63bcc96922
commit 92e1ba6acf
2 changed files with 26 additions and 23 deletions

View File

@@ -50,20 +50,12 @@
* If you'd rather forego this, you may use 'paint_color = "#ffaa22";' instead, at your own peril.
*
*
* --- setStrength() ---
* --- setOpacity() ---
*
* Updates the tool strenght to that of the 'Tool Strenght' input, sanitizing it's value in the process. Turns
* NaNs to 0, rounds the value to the second decimal and clamps it to the min. and max. values.
* Useful if you wish to let the user modify the strength directly.
*
*
* --- changeStrength(diff) ---
*
* Modifies the tool strenght by 'diff', sanitizes the result and updates the value of the 'Tool Strenght' input.
* 'diff' should be no lower than 0.01, any values lower than that will end up ignored once the result's sanitized.
* Useful if placing buttons to increase/decrease the tool strenght, rather than modifying it directly.
*
*
* --- hexToRgba(hex), rgbaToHex(r, g, b) ---
*
* Helper functions to deal with rgb/hex conversions.