struct IntelQA::Carrier::G
- IntelQA::Carrier::G
- Struct
- Value
- Object
Defined in:
color_model/from_channels.crcolor_model/from_hex.cr
color_model/mixing.cr
color_model/named_colors.cr
color_model/to_relative.cr
color_models.cr
Constant Summary
-
BLACK =
G.from_hex("#000000") -
DARKGRAY =
G.from_hex("#A9A9A9") -
DARKGREY =
G.from_hex("#A9A9A9") -
DIMGRAY =
G.from_hex("#696969") -
DIMGREY =
G.from_hex("#696969") -
GAINSBORO =
G.from_hex("#DCDCDC") -
GRAY =
G.from_hex("#808080") -
GREY =
G.from_hex("#808080") -
LIGHTGRAY =
G.from_hex("#D3D3D3") -
LIGHTGREY =
G.from_hex("#D3D3D3") -
MAX =
G.new(["UInt16::MAX"]) -
MAX_INTENSITY =
13 -
MIN =
G.new -
NULL =
G.new -
RESOLUTION =
16 -
SILVER =
G.from_hex("#C0C0C0") -
WHITE =
G.from_hex("#FFFFFF") -
WHITESMOKE =
G.from_hex("#F5F5F5")
Constructors
Class Method Summary
-
.from_g_n(g, n)
Create a
RGBAstruct from n-bit red, green and blue values -
.from_hex(hex : String)
Create a
RGBAstruct from a hex color string. -
.from_relative(r, g, b)
Create a RGBA struct from float values
r,#g,b,aranging from0.0to1.0.
Instance Method Summary
- #g : UInt16
- #gray : UInt16
-
#mix(other, t)
Linear interpolation (mixing) of two colors.
-
#multiply(other : G) : G
Mix two colors by multiplying their values
-
#over(other : G) : G
Mix two colors by using Alhpa Compositing
-
#to_relative
Create a tuple
{r, g, b, a}, each ranging from0.0to1.0from this color.
Constructor Detail
Class Method Detail
def self.from_hex(hex : String)
#
def self.from_relative(r, g, b)
#
Create a RGBA struct from
float values r, #g, b, a
ranging from 0.0 to 1.0.
{1.0, 0.0, 0.0, 0.5} would be the color red
with an opacity of 50%.
Instance Method Detail
def mix(other, t)
#
Linear interpolation
(mixing) of two colors.
t ranges from 0.0 to 1.0.
a.mix(b, 0.0) == a
a.mix(b, 1.0) == b