managarten/apps/context/apps/mobile/utils/debug.ts
Till-JS bb0e0cf5cb 🚚 feat(context): integrate context app into monorepo
Restructure the context app (formerly basetext) to follow the monorepo
pattern with proper workspace configuration.

Changes:
- Move app files to apps/context/apps/mobile/
- Rename package to @context/mobile
- Update bundle ID to com.manacore.context
- Create pnpm-workspace.yaml for project workspace
- Add dev scripts to root package.json
- Update CLAUDE.md with project documentation

The app structure is prepared for future web/backend additions.

Note: Existing TypeScript errors in the original codebase are preserved.
These should be fixed in a follow-up PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 15:09:04 +01:00

44 lines
1.1 KiB
TypeScript

import { ViewStyle } from 'react-native';
/**
* Fügt Debug-Borders zu einem Style-Objekt hinzu
* @param baseStyle Das Basis-Style-Objekt
* @param color Die Farbe des Debug-Rahmens (optional)
* @param showBorder Flag, ob der Debug-Rahmen angezeigt werden soll
* @returns Das Style-Objekt mit Debug-Rahmen (wenn aktiviert)
*/
export const addDebugBorder = (
baseStyle: ViewStyle,
color: string = '#ff0000',
showBorder: boolean = false
): ViewStyle => {
if (!showBorder) return baseStyle;
return {
...baseStyle,
borderWidth: 1,
borderColor: color,
};
};
/**
* Generiert zufällige Debug-Farben für verschiedene UI-Elemente
*/
export const debugColors = {
container: '#ff0000', // Rot
section: '#00ff00', // Grün
item: '#0000ff', // Blau
header: '#ff00ff', // Magenta
content: '#ffff00', // Gelb
footer: '#00ffff', // Cyan
// Generiert eine zufällige Farbe für andere Elemente
random: () => {
const letters = '0123456789ABCDEF';
let color = '#';
for (let i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
},
};