diff --git a/desktop/plugins/public/ui-debugger/components/sidebarV2/AttributesInspector.tsx b/desktop/plugins/public/ui-debugger/components/sidebarV2/AttributesInspector.tsx index b1e843f46..34d77f6e4 100644 --- a/desktop/plugins/public/ui-debugger/components/sidebarV2/AttributesInspector.tsx +++ b/desktop/plugins/public/ui-debugger/components/sidebarV2/AttributesInspector.tsx @@ -8,10 +8,11 @@ */ import {Divider, Input, Typography} from 'antd'; -import {Panel, theme, Layout} from 'flipper-plugin'; +import {Panel, theme, Layout, styled} from 'flipper-plugin'; import React from 'react'; import { ClientNode, + Color, Inspectable, InspectableObject, Metadata, @@ -21,6 +22,7 @@ import {NoData} from '../sidebar/inspector/NoData'; import {css, cx} from '@emotion/css'; import {upperFirst, sortBy} from 'lodash'; import {any} from 'lodash/fp'; +import {InspectableColor} from '../../ClientTypes'; export function AttributesInspector({ node, @@ -391,38 +393,89 @@ function AttributeValue({ ); case 'space': return ( - - - - + ); case 'bounds': return ( - - - - + ); + + case 'color': + return ; } return null; } + +function ColorInspector({inspectable}: {inspectable: InspectableColor}) { + return ( + + + + + + + + ); +} + +const ColorPreview = styled.div(({background}: {background: string}) => ({ + width: '28px', + height: '28px', + borderRadius: '8px', + borderColor: theme.disabledColor, + borderStyle: 'solid', + boxSizing: 'border-box', + borderWidth: '1px', + backgroundColor: background, +})); + +const RGBAtoHEX = (color: Color) => { + const hex = + (color.r | (1 << 8)).toString(16).slice(1) + + (color.g | (1 << 8)).toString(16).slice(1) + + (color.b | (1 << 8)).toString(16).slice(1); + + return '#' + hex.toUpperCase(); +}; + +type FourItemArray = [T, T, T, T]; + +function TwoByTwoNumberGroup({ + values, +}: { + values: FourItemArray; +}) { + return ( + + + + + ); +}