QColorConstants Namespace

QColorConstants 네임스페이스에는 QColor 사전 정의된 상수가 포함되어 있습니다. 더 보기...

헤더: #include <QColorConstants>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui

상세 설명

이 상수는 QColor 객체가 예상되는 모든 곳에서 사용할 수 있습니다:

painter.setBrush(QColorConstants::Svg::lightblue);

문자열을 구문 분석할 필요가 없고 항상 유효한 QColor 객체를 생성하므로 QColor 의 생성자에 문자열을 전달하는 것보다 훨씬 저렴하게 사용할 수 있습니다:

object.setColor(QColor("lightblue")); // expensive

Qt 색

QColorConstants 네임스페이스에는 다음과 같은 색이 정의되어 있습니다:

NameHexColor
Color0#000000
Color1#ffffff
검은색#000000
흰색#ffffff
다크그레이#808080
회색#a0a0a4
LightGray#c0c0c0
빨간색#000000
녹색#00ff00
파란색#000000ff
Cyan#00ffff
마젠타#0000ff
Yellow#00ff00
다크레드#800000
다크그린#008000
DarkBlue#000080
다크 시안#008080
다크마젠타#800080
DarkYellow#808000
투명#00000000(투명)

SVG 색상

다음 표에는 사용 가능한 SVG 색상이 나열되어 있습니다. 이러한 색상은 QColorConstants::Svg 내부 네임스페이스에서 사용할 수 있습니다.

이름Hex색상
aliceblue#f0f8ff
앤틱화이트#faebd7
아쿠아#00ffff
아쿠아 마린#7fffd4
하늘색#f0ffff
베이지#f5f5dc
비스크#fe4c4
검은색#000000
블랑쉬드아몬드#ffebcd
blue#0000ff
블루바이올렛#8a2be2
갈색#a52a2a
burlywood#deb887
cadetblue#5f9ea0
연두색#7fff00
초콜릿#d2691e
coral#FF7F50
콘플라워블루#6495ed
옥수수 실크#fff8dc
크림슨#DC143C
시안#00ffff
다크블루#00008b
다크 시안#008b8b
다크골든로드#b8860b
다크그레이#a9a9a9
darkgreen#006400
다크 그레이#a9a9a9
다크카키#bdb76b
다크마젠타#8b008b
다크올리브그린#556b2f
darkorange#ff8c00
다크 오키드#9932cc
darkred#8b0000
darksalmon#e9967a
darkseagreen#8fbc8f
다크슬레이트블루#483d8b
darkslategray#2f4f4f
darkslategrey#2f4f4f
darkturquoise#00ced1
다크바이올렛#9400d3
deeppink#ff1493
딥스카이블루#00bfff
딤그레이#696969
딤그레이#696969
도저블루#1e90ff
firebrick#b22222
플로럴화이트#fffaf0
숲 녹색#228b22
자홍색#0000ff
게인즈버러#dcdcdc
고스트화이트#f8f8ff
gold#ffd700
goldenrod#daa520
회색#808080
회색#808080
녹색#008000
greenyellow#adff2f
허니듀#f0fff0
핫핑크#ff69b4
indianred#cd5c5c
인디고#4b0082
아이보리#fffff0
카키#f0e68c
라벤더#e6e6fa
라벤더블러쉬#ff0f5
lawngreen#7cfc00
레몬시폰#fffacd
라이트블루#add8e6
라이트코랄#f08080
라이트 시안#e0ffff
라이트골든로디옐로우#fafad2
라이트그레이#d3d3d3
라이트그린#90ee90
lightgrey#d3d3d3
lightpink#ffb6c1
lightsalmon#fa07a
lightseagreen#20b2aa
lightskyblue#87cefa
lightslategray#778899
lightslategrey#778899
라이트스틸블루#b0c4de
lightyellow#ffffe0
라임#00ff00
라임그린#32cd32
린넨#faf0e6
마젠타#0000ff
적갈색#800000
미디엄아쿠아마린#66cdaa
mediumblue#0000cd
mediumorchid#ba55d3
mediumpurple#9370db
mediumseagreen#3cb371
mediumslateblue#7b68ee
mediumspringgreen#00fa9a
mediumturquoise#48d1cc
미디엄바이올렛레드#c71585
미드나잇블루#191970
민트크림#f5fffa
미스티로즈#ffe4e1
모카신#ffe4b5
나바조화이트#ffdead
네이비#000080
oldlace#fdf5e6
올리브#808000
올리브#6b8e23
오렌지#ffa500
오렌지#ff4500
난초#da70d6
palegoldenrod#ee8aa
연두색#98fb98
팔레터콰이즈#afeeee
페일바이올렛레드#db7093
파파야힙#ffefd5
peachpuff#ffdab9
페루#cd853f
핑크#ffc0cb
자두#dda0dd
파우더블루#b0e0e6
보라색#800080
빨간색#000000
로시브라운#bc8f8f
로얄블루#4169e1
새들브라운#8b4513
살몬#fa8072
샌드브라운#f4a460
seagreen#2e8b57
조개#fff5ee
sienna#a0522d
silver#c0c0c0
하늘색#87ceeb
슬레이트블루#6a5acd
슬레이트그레이#708090
슬레이트그레이#708090
snow#fffafa
springgreen#00ff7f
강철색#4682b4
tan#d2b48c
청록#008080
엉겅퀴#d8bfd8
토마토#FF6347
청록색#40e0d0
보라색#eee82ee
#f5deb3
흰색#ffffff
흰 연기#f5f5f5
노란색#ffff00
황록색#9acd32

QColorQt::GlobalColor참조하세요 .

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.