Skip to content

Commit

Permalink
minor format
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfrancisco committed Aug 21, 2024
1 parent 60be4cc commit 025f1ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/figma-to-design-tokens/src/extractors/color.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DesignToken } from 'style-dictionary/types';
import type { DesignToken } from 'style-dictionary/types';
import { toHex } from 'color2k';
import { FigmaExtractedVariable } from '../types';
import type { FigmaExtractedVariable } from '../types';

const convertChannel = (value: number): number => {
return Math.round(value * 255);
Expand Down Expand Up @@ -32,13 +32,13 @@ export function extractColor(
}

const extractedValue = (() => {
// RGB | RGBA | VariableAlias
if ('a' in value || 'r' in value) {
// RGBA
// RGB | RGBA
return toHex(toRgba(value));
}

if ('id' in value && value.type === 'VARIABLE_ALIAS') {
if ('id' in value) {
// VariableAlias
return value.id;
}
})();
Expand Down

0 comments on commit 025f1ea

Please sign in to comment.