0.0.1 • Published 3 years ago

@solariera/rgba-syntax v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

RGBA Syntax

Getting the RGBA syntax for CSS.

1. Usage

1-1. Installation

# npm
npm install @solariera/rgba-syntax
# yarn
yarn add @solariera/rgba-syntax

1-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.NameTypeDescription
1codestringHexadecimal color code
2alphanumberAlpha channel value