[CSS] 7) 색 표현법, 색 넣기 (#HSLA # RGB)

2021. 1. 19. 18:51· Web
목차
  1. DAY7

 

Codecademy front-end engineer course

DAY7

  • Learn CSS: Color

 

- Introduction of Color [색 표현법 종류]

Named Color English words that describe colors, also called keyword colors
RGB numeric values that describe a mix of red, green, and blue
HSL numeric values that describe a mix of hue, saturation, and lightness

 

- Two types of Color[배경색, 글씨 색]

color this property styles an element’s foreground color.
background-color this property styles an element’s background color.

 

- Hexademical (16진수)

: A hex color begins with a hash character (#) which is followed by three or six characters.

*the hexadecimal number system has 16 digits (0-15) instead of 10 (0-9)

*the values with doubled digits for each color value can be shortened to there characters. (like below code)Hex 

Black:        #000000 or #000
White:        #FFFFFF or #FFF
Aqua:         #00FFFF or #0FF

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

 

- CSS: Cascading Style Sheets | MDN

The data type is specified using one of the options listed below. Note: Although values are precisely defined, their actual appearance may vary (sometimes significantly) from device to device. This is because most devices are not calibrated, and some brows

developer.mozilla.org

 

- RGB Colors

:each of the three values represents a color component, and each can have a decimal number value from 0 to 255.

(red, green, blue)

:using decimal number

h1 {
  color: rgb(23, 45, 23);
}

* RGB이든 Hexademical한 방법이든 하나로 통일하는 것이 좋음.

 - CSS color는 147개만 제공하는 반면, 위의 표현방식을 이용하면 256*256*256=16,777,216개 표현 가능.

 

 

- Hue, Saturation, and Lightness (HSL)

* 특성을 비슷하게 색을 여러개로 만들고 싶을 때 한 숫자만 바꿔도 돼 유용.

Hue an angle on a color wheel.

Saturation refers to the intensity or purity of the color.

- increases towards 100% -> gets closer to the edge (the color becomes more rich)
-  decreases towards 0% -> gets closer to the center (the color becomes more gray)
Lightness how light or dark the color is. Halfway, or 50%, is normal lightness.

- 100% makes the color lighter, closer to white. 
- 0% makes the color darker, closer to black

 

 

- Opacity & Alpha [투명도]

:opacity, or the amount of transparency

 

1) HSLA

:alpha is zero, the color will be completely transparent. If alpha is one, the color will be opaque.

color: hsla(34, 100%, 50%, 0.1);

2) RGBA

color: rgba(234, 45, 98, 0.33);

 - the alpha value as, “the amount of the background to mix with the foreground”. (it mix for each pixel.)

 

3)

 - CSS color나 16진법으로 대체 불가능.

 - transparent 는 서로 대체 가능.

color: transparent;
color: rgba(0, 0, 0, 0);

 

반응형
저작자표시 (새창열림)

'Web' 카테고리의 다른 글

[Front-end] 9) 프로젝트 - 정리노트 웹페이지 만들기  (0) 2021.01.24
[CSS] 8) 웹 페이지 폰트 설정, 연결하는 법 (#typography #font-family)  (0) 2021.01.24
[Front-end] 6) Github로 웹페이지 만들기/Semantic CSS  (0) 2021.01.19
[Front-end] 5)CSS 비주얼 규칙/ Visual Studio Code로 웹페이지 만들기  (0) 2021.01.17
[CSS] 4)CSS 구조/선택자 Selector  (0) 2021.01.17
  1. DAY7
'Web' 카테고리의 다른 글
  • [Front-end] 9) 프로젝트 - 정리노트 웹페이지 만들기
  • [CSS] 8) 웹 페이지 폰트 설정, 연결하는 법 (#typography #font-family)
  • [Front-end] 6) Github로 웹페이지 만들기/Semantic CSS
  • [Front-end] 5)CSS 비주얼 규칙/ Visual Studio Code로 웹페이지 만들기
이티권
이티권
programming, design
이티권
ET WORLD
이티권
전체
오늘
어제
  • 분류 전체보기 (85)
    • Web (43)
      • Three.js (1)
      • javascript (6)
      • React (2)
    • algorithm (18)
      • BOJ (6)
    • Record (9)
      • 생각 (6)
      • 경험 (3)
    • Art (7)
    • Technology (8)
      • Data (2)
      • Info (5)

블로그 메뉴

  • WEB
  • RECORD
  • ALGORITHM
  • TECH
  • ART

공지사항

인기 글

태그

  • 깃 CLI
  • 나머지매개변수
  • C언어
  • 순환
  • 맥북소리녹화
  • ChatGPT
  • 레포지터리만들기
  • 퓨 이벤트
  • 컴포넌트 통신
  • 불확신
  • html tag
  • 알고리즘
  • 뷰링크
  • 스프레드문법
  • 시니어프론트엔드개발자
  • 재귀함수
  • 깃허브시작
  • 포토샵
  • 뷰 프롭스
  • 컴퓨터공학힘든가요
  • 페이지 링크
  • 알고리즘문제
  • HTML
  • vue.js
  • 깃허브하는법
  • CSS
  • js
  • 뷰라우터
  • svgr
  • 기명함수 표현식

최근 댓글

최근 글

hELLO · Designed By 정상우.v4.2.1
이티권
[CSS] 7) 색 표현법, 색 넣기 (#HSLA # RGB)
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.