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:
@@ -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,
|
||||
|
@@ -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("#", "");
|
||||
|
Reference in New Issue
Block a user