@solariera/rgba-syntax
v0.0.1
Published
Getting the RGBA syntax for CSS
Downloads
1
Readme
RGBA Syntax
Getting the RGBA syntax for CSS.
1. Usage
1-1. Installation
# npm
npm install @solariera/rgba-syntax# yarn
yarn add @solariera/rgba-syntax1-2. Basic Usage
import React from 'react';
import styled from 'styled-components';
import { rgba } from '@solariera/rgba-syntax';
export const ColorText: React.FC = () => {
return <Color { code: '#393D47', alpha: 0.6 }>{'hello world'}</Color>;
};
const Color = styled.div`
color: ${(props) => rgba(props.code, props.alpha)};
${/* rgba(57, 61, 71, 0.6) */}
`;2. Specifications
2-1. Syntax
rgba(
code[,alpha])
2-2. Parameters
| No. | Name | Type | Description |
| --- | ------- | ------ | ---------------------- |
| 1 | code | string | Hexadecimal color code |
| 2 | alpha | number | Alpha channel value |
