mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-11-18 03:34:43 +01:00
Co-authored-by: Maielo <maielo.mv@gmail.com> Co-authored-by: dwelle <luzar.david@gmail.com> Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
30 lines
566 B
TypeScript
30 lines
566 B
TypeScript
import React from "react";
|
|
import { getContrastYIQ } from "./colorPickerUtils";
|
|
|
|
interface HotkeyLabelProps {
|
|
color: string;
|
|
keyLabel: string | number;
|
|
isCustomColor?: boolean;
|
|
isShade?: boolean;
|
|
}
|
|
const HotkeyLabel = ({
|
|
color,
|
|
keyLabel,
|
|
isCustomColor = false,
|
|
isShade = false,
|
|
}: HotkeyLabelProps) => {
|
|
return (
|
|
<div
|
|
className="color-picker__button__hotkey-label"
|
|
style={{
|
|
color: getContrastYIQ(color, isCustomColor),
|
|
}}
|
|
>
|
|
{isShade && "⇧"}
|
|
{keyLabel}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default HotkeyLabel;
|