Skip to content

Commit

Permalink
Removed most long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Jan 24, 2025
1 parent ef3548e commit 92e7291
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/core/iridescence.Rgb12Opaque.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ object Rgb12Opaque:
given underlying: Underlying[Rgb12, Int] = ###
given Rgb12 is Chromatic = _.srgb.rgb24.asInt

def apply(red: Int, green: Int, blue: Int): Rgb12 = ((red&15) << 8) + ((green&15) << 4) + (blue&15)
def apply(red: Int, green: Int, blue: Int): Rgb12 =
((red&15) << 8) + ((green&15) << 4) + (blue&15)

extension (color: Rgb12)
def red: Int = (color >> 8)&15
Expand Down
4 changes: 3 additions & 1 deletion src/core/iridescence.Rgb24Opaque.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ object Rgb24Opaque:
given underlying: Underlying[Rgb24, Int] = ###
given Rgb24 is Chromatic = _.asInt

def apply(red: Int, green: Int, blue: Int): Rgb24 = ((red&255) << 16) + ((green&255) << 8) + (blue&255)
def apply(red: Int, green: Int, blue: Int): Rgb24 =
((red&255) << 16) + ((green&255) << 8) + (blue&255)

def apply(packedInt: Int): Rgb24 = packedInt & 0x00ffffff

extension (color: Rgb24)
Expand Down
3 changes: 2 additions & 1 deletion src/core/iridescence.Rgb32Opaque.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ object Rgb32Opaque:
given underlying: Underlying[Rgb32, Int] = ###
given Rgb32 is Chromatic = _.srgb.rgb24.asInt

def apply(red: Int, green: Int, blue: Int): Rgb32 = ((red&1023) << 22) + ((green&4095) << 10) + (blue&1023)
def apply(red: Int, green: Int, blue: Int): Rgb32 =
((red&1023) << 22) + ((green&4095) << 10) + (blue&1023)

extension (color: Rgb32)
def red: Int = (color >> 22)&1023
Expand Down
3 changes: 2 additions & 1 deletion src/core/iridescence.RgbHex.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ object RgbHex extends Interpolator[Nothing, Option[Rgb24], Rgb24]:
rgb"rrggbb" where rr, gg and bb are 2-digit hex values""", 0)

def insert(state: Option[Rgb24], value: Nothing): Option[Rgb24] =
throw InterpolationError(m"substitutions into an ${Text("rgb\"\"")} interpolator are not supported")
throw InterpolationError:
m"substitutions into an ${Text("rgb\"\"")} interpolator are not supported"

def skip(state: Option[Rgb24]): Option[Rgb24] = state
def complete(color: Option[Rgb24]): Rgb24 = color.get
15 changes: 12 additions & 3 deletions src/core/iridescence.colorProfiles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ import language.experimental.captureChecking

object colorProfiles:
given incandescentTungsten: ColorProfile = ColorProfile(109.850, 100, 35.585, 111.144, 100, 35.2)
given oldDirectSunlightAtNoon: ColorProfile = ColorProfile(99.0927, 100, 85.313, 99.178, 100, 84.3493)

given oldDirectSunlightAtNoon: ColorProfile =
ColorProfile(99.0927, 100, 85.313, 99.178, 100, 84.3493)

given oldDaylight: ColorProfile = ColorProfile(98.074, 100, 118.232, 97.285, 100, 116.145)
given iccProfilePcs: ColorProfile = ColorProfile(96.422, 100, 82.521, 96.720, 100, 81.427)
given midMorningDaylight: ColorProfile = ColorProfile(95.682, 100, 92.149, 95.799, 100, 90.926)
Expand All @@ -29,7 +32,10 @@ object colorProfiles:
given adobeRgb: ColorProfile = daylight
given northSkyDaylight: ColorProfile = ColorProfile(94.972, 100, 122.638, 94.416, 100, 120.641)
given equalEnergy: ColorProfile = ColorProfile(100, 100, 100, 100, 100, 100)
given daylightFluorescentF1: ColorProfile = ColorProfile(92.834, 100, 103.665, 94.791, 100, 103.191)

given daylightFluorescentF1: ColorProfile =
ColorProfile(92.834, 100, 103.665, 94.791, 100, 103.191)

given coolFluorescent: ColorProfile = ColorProfile(99.187, 100, 67.395, 103.280, 100, 69.026)
given whiteFluorescent: ColorProfile = ColorProfile(103.754, 100, 49.861, 108.968, 100, 51.965)

Expand All @@ -38,7 +44,10 @@ object colorProfiles:

given daylightFluorescentF5: ColorProfile = ColorProfile(90.872, 100, 98.723, 93.369, 100, 98.636)
given liteWhiteFluorescent: ColorProfile = ColorProfile(97.309, 100, 60.191, 102.148, 100, 62.074)
given daylightFluorescentF7: ColorProfile = ColorProfile(95.044, 100, 108.755, 95.792, 100, 107.687)

given daylightFluorescentF7: ColorProfile =
ColorProfile(95.044, 100, 108.755, 95.792, 100, 107.687)

given d65Simulator: ColorProfile = daylightFluorescentF7
given sylvaniaF40: ColorProfile = ColorProfile(96.413, 100, 82.333, 97.115, 100, 81.135)
given d50Simulator: ColorProfile = sylvaniaF40
Expand Down

0 comments on commit 92e7291

Please sign in to comment.