feat: make author clickable
This commit is contained in:
@@ -104,3 +104,15 @@ export const isLocalImage = (src: string) =>
|
||||
export const isString = (input: string | undefined): input is string => {
|
||||
return typeof input === "string";
|
||||
};
|
||||
|
||||
function componentToHex(c: number) {
|
||||
if (c <= 1) {
|
||||
c = Math.round(c * 255);
|
||||
}
|
||||
const hex = c.toString(16);
|
||||
return hex.length == 1 ? "0" + hex : hex;
|
||||
}
|
||||
|
||||
export function rgbToHex(r: number, g: number, b: number) {
|
||||
return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user