Skip to content

Main content

Convert Illuminance Source Code

Browse the implementation files for Convert Illuminance.
@tool.io/tools/convert/illuminance source ↗
tool.ts typescript
import { convertIlluminance as convertPortableIlluminance } from '@tool.io/tools/convert/illuminance';
import { measureFactorOptions } from '../tool';
import { measureFactors } from './factors';

export const convertIlluminance = (
	value: number,
	from: string,
	to: string
) => convertPortableIlluminance(value, from, to) ?? '';

export const Tool: TypeTool = {
	name: 'Convert Illuminance',
	slug: 'convert/illuminance',
	tool: convertIlluminance,
	intro:
		'Convert light arriving at a surface between lux, foot-candles, phot, nox, and SI-prefixed lux units.',
	i: [
		{
			example: '100',
			label: 'Value',
			placeholder: '100',
			type: 'number'
		},
		{
			example: 'fc',
			label: 'From',
			options: measureFactorOptions(measureFactors, 'fc'),
			placeholder: 'Select the source illuminance unit',
			type: 'select',
			value: 'fc'
		},
		{
			example: 'lx',
			label: 'To',
			options: measureFactorOptions(measureFactors, 'lx'),
			placeholder: 'Select the destination illuminance unit',
			type: 'select',
			value: 'lx'
		}
	],
	o: [
		{
			example: '1076.39104167',
			label: 'Illuminance',
			placeholder: 'Converted illuminance',
			render: 'textarea',
			type: 'number'
		}
	],
	swap: {
		inputs: [1, 2],
		name: 'Swap illuminance units',
		state: false
	},
	alternative: [
		{
			title: 'Candela to Lux Calculator',
			url: '/lighting/candela-to-lux-calculator'
		},
		{
			title: 'Lumens to Lux Calculator',
			url: '/lighting/lumens-to-lux-calculator'
		},
		{
			title: 'Convert luminous intensity',
			url: '/convert/luminous-intensity'
		}
	],
	cite: [
		{
			title: 'Lux — NIST',
			url: 'https://www.nist.gov/glossary-term/26871'
		}
	]
};

export default Tool;

Description

Browse the implementation files for Convert Illuminance.

References

  1. Tool.io on GitHub
  2. Tool.io TypeScript tools library

Similar or alternative tools