diff --git a/composables/useCalc.ts b/composables/useCalc.ts index 214937f..c8badf7 100644 --- a/composables/useCalc.ts +++ b/composables/useCalc.ts @@ -5,12 +5,13 @@ export const predefLamelleColors = ['3009', '9003', '6027', '5024', '9001', '101 const n = 2 const min = 1300 +const random_pair = Math.floor(Math.random() * predefPillarColors.length) export const use_lamelle_height = () => useState('lamelle_height', () => 0.115) export const use_lamelles_count = () => useState('lamelles_count', () => 14) export const use_fence_section = () => useState('fence_section', () => min * 0.001) export const use_remove_pillar = () => useState('remove_pillar', () => false) -export const use_pillar_color = () => useState('pillar_color', () => predefPillarColors[Math.floor(Math.random() * predefPillarColors.length)] as ralTypes) -export const use_lamelle_color = () => useState('lamelle_color', () => predefLamelleColors[Math.floor(Math.random() * predefLamelleColors.length)] as ralTypes) +export const use_pillar_color = () => useState('pillar_color', () => predefPillarColors[random_pair] as ralTypes) +export const use_lamelle_color = () => useState('lamelle_color', () => predefLamelleColors[random_pair] as ralTypes) export const use_section_count = () => useState('section_count', () => n) export const use_extra_section = () => useState('extra_section', () => 0) export const use_total_length = () => useState('total_length', () => (((min + 104) * n) + 104) * 0.001)