1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 09:26:34 +02:00

fix: clarify util name

This commit is contained in:
protoclown
2022-09-25 18:19:53 +02:00
parent 48b3c07c4e
commit bd0e6638cc
2 changed files with 6 additions and 5 deletions

View File

@@ -33,7 +33,7 @@ import formatNumber from './utils/formatNumber';
import mapRoutes from './utils/mapRoutes';
import withAttr from './utils/withAttr';
import * as FocusTrap from './utils/focusTrap';
import yiqValue from './utils/yiqValue';
import getContrast from './utils/getContrast';
import Notification from './models/Notification';
import User from './models/User';
import Post from './models/Post';
@@ -121,7 +121,7 @@ export default {
'utils/throttleDebounce': ThrottleDebounce,
'utils/isObject': isObject,
'utils/focusTrap': FocusTrap,
'utils/yiqValue': yiqValue,
'utils/getContrast': getContrast,
'models/Notification': Notification,
'models/User': User,
'models/Post': Post,

View File

@@ -1,9 +1,10 @@
/**
* The `yiqValue` utility converts a hex color to rgb, and then calcul a yiq
* contrast value.
* The `getContrast` utility converts a hex color to rgb, and then calcul a YIQ
* value in order to get the appropriate contrast value (is it dark or is it
* light?) See https://www.w3.org/TR/AERT/#color-contrast for references
*/
export default function yiqValue(hexcolor: String) {
export default function getContrast(hexcolor: String) {
var hexnumbers = hexcolor.replace("#", "");